Changeset 5654

Show
Ignore:
Timestamp:
08/08/12 04:22:42 (7 years ago)
Author:
albert
Message:

Second and final partial fix for #1084

Location:
seattle/trunk
Files:
18 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/custominstallerbuilder/common/constants.py

    r4357 r5654  
    1818 
    1919# The complete set of platforms supported by the Custom Installler Builder. 
    20 PLATFORMS = set(['linux', 'mac', 'windows']) 
     20PLATFORMS = set(['linux', 'mac', 'windows', 'android']) 
    2121 
    2222# For each platform listed above, it should belong to one of the following 
     
    2424TGZ_PLATFORMS = set(['linux', 'mac']) 
    2525ZIP_PLATFORMS = set(['windows']) 
     26APK_PLATFORMS = set(['android']) 
    2627 
    2728# For each platform listed above, provide the name of the base installer 
     
    3132  'mac': 'seattle_mac.tgz', 
    3233  'windows': 'seattle_win.zip', 
     34  'android': 'seattle_android.apk', 
    3335} 
    3436 
     
    6769FILE_PERMISSIONS = 0644 
    6870DIR_PERMISSIONS = 0755 
     71 
  • seattle/trunk/custominstallerbuilder/common/packager.py

    r4338 r5654  
    130130    os.remove(temp) 
    131131    os.chmod(orig, constants.FILE_PERMISSIONS) 
     132 
     133  for platform in (constants.APK_PLATFORMS & set(build_platforms)): 
     134    orig = base_installers[platform] 
     135    align = base_installers[platform] + '.align' 
     136 
     137    # Modify seattle.zip 
     138    subprocess.call(['unzip', orig, 'res/raw/seattle.zip'], cwd=working_dir) 
     139    subprocess.call(['zip', '-r', './res/raw/seattle.zip', config_dir_rel], cwd=working_dir) 
     140    subprocess.call(['zip', '-r', orig, './res'], cwd=working_dir) 
     141    # Sign and align the apk 
     142    subprocess.call(['jarsigner', '-digestalg', 'SHA1', '-sigfile', 'CERT',  
     143                     '-keystore', settings.ANDR_KEYSTORE_PATH, '-storepass', 
     144                     settings.ANDR_KEYSTORE_PASS, '-keypass', settings.ANDR_KEY_PASS, 
     145                     orig, settings.ANDR_KEY_NAME], cwd=working_dir) 
     146    subprocess.call(['zipalign', '4', orig, align], cwd=working_dir) 
     147    os.remove(orig) 
     148    shutil.move(align, orig) 
     149 
     150    shutil.rmtree(os.path.abspath(os.path.join(working_dir, 'res'))) 
    132151 
    133152  # Remove the working directories. 
  • seattle/trunk/custominstallerbuilder/html/templates/download_installers.html

    r4338 r5654  
    6969      </td>  
    7070    </tr> 
     71    <tr id="android">  
     72      <td><a href="{{ installers.android }}"><img src="{{ MEDIA_URL }}/img/android.png" alt="android" /></a><br /><a class="button" href="{{ installers.android }}">Download installer<br />for Android</a></td>  
     73      <td> 
     74        <p><strong>Android instructions</strong></p> 
     75         
     76        <ol>  
     77          <li>Download and install the APK on your handset.</li>  
     78          <li>Start the app and follow the on-screen instruction.</li>  
     79        </ol> 
     80         
     81        <p>Note: Your device must have Android 2.1 or newer installed.</p> 
     82      </td> 
     83    </tr> 
    7184  </table> 
    7285   
  • seattle/trunk/custominstallerbuilder/local_template/settings.py

    r4338 r5654  
    4646# The locations of the customized installers created by this program. 
    4747CUSTOM_INSTALLER_URL = PROJECT_URL + 'static/installers/' 
     48 
     49# Location of the keystore. Change this in your local install 
     50ANDR_KEYSTORE_PATH = 'path/to/keystore' 
     51 
     52# Keystore password. Change this in your local install 
     53ANDR_KEYSTORE_PASS = 'keystore-password' 
     54 
     55# Key password. Change this in your local install 
     56ANDR_KEY_PASS = 'key-password' 
     57 
     58# Key name. Change this in your local install 
     59ANDR_KEY_NAME = 'key-name' 
  • seattle/trunk/custominstallerbuilder/settings_base.py

    r4338 r5654  
    131131SERVE_STATIC = False 
    132132STATIC_BASE = 'static/' 
     133 
     134# Android keystore settings 
     135ANDR_KEYSTORE_PATH = '' 
     136ANDR_KEYSTORE_PASS = '' 
     137ANDR_KEY_PASS = '' 
     138ANDR_KEY_NAME = '' 
  • seattle/trunk/nodemanager/nmAPI.mix

    r5637 r5654  
    6969# import for Popen 
    7070import portable_popen 
     71 
     72# Fix for #1081, use sys.executable instead of "python" 
     73import sys 
     74 
     75 
     76 
    7177 
    7278offcutfilename = "resources.offcut" 
  • seattle/trunk/oddball/tests/ut_oddball_stop.2.py

    r3490 r5654  
    11import utfutil 
     2import utf 
     3 
     4 
    25 
    36def main(): 
     
    912               ] 
    1013 
    11   output = (out, error) = utfutil.execute_repy(repy_args) 
     14  (rawout, error) = utfutil.execute_repy(repy_args) 
     15 
     16  out = utf.strip_android_debug_messages(rawout) 
     17 
    1218  if not error or out: print 'FAIL' 
    1319 
  • seattle/trunk/oddball/tests/ut_oddball_sub.py

    r3490 r5654  
    11import os 
    2  
     2import utf 
    33import utfutil 
    44 
     
    1616              ] 
    1717 
    18   (out, error) = utfutil.execute_repy(repy_args) 
     18  (rawout, error) = utfutil.execute_repy(repy_args) 
     19 
     20  out = utf.strip_android_debug_messages(rawout) 
    1921 
    2022  if out or error: print 'FAIL' 
  • seattle/trunk/repy/tests/ut_repytests_testclose.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testclose.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testclose.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testfileinit.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testfileinit.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testfileinit.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testflush.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testflush.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testflush.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testnext.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testnext.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testnext.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testopen.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testopen.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testopen.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testread.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testread.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testread.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testreadline.py

    r5637 r5654  
    11import subprocess 
    22import time 
    3  
    43import sys 
     4import utf 
    55 
    66processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testreadline.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    7 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    88processOne.wait() 
    99processTwo = subprocess.Popen([sys.executable, 's_testreadline.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    10 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1111processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1215 
    1316if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testreadlines.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testreadlines.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testreadlines.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testseek.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testseek.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testseek.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
    1112 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1215 
    1316if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: 
  • seattle/trunk/repy/tests/ut_repytests_testwrite2.py

    r5637 r5654  
    22import time 
    33import sys 
     4import utf 
    45 
    56processOne = subprocess.Popen([sys.executable, 'repy.py', '--simple', 'restrictions.default', 's_testwrite2.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    6 (stdoutFirst, stderrFirst) = processOne.communicate() 
     7(rawstdoutFirst, stderrFirst) = processOne.communicate() 
    78processOne.wait() 
    89processTwo = subprocess.Popen([sys.executable, 's_testwrite2.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
    9 (stdoutSecond, stderrSecond) = processTwo.communicate() 
     10(rawstdoutSecond, stderrSecond) = processTwo.communicate() 
    1011processTwo.wait() 
     12 
     13stdoutFirst = utf.strip_android_debug_messages(rawstdoutFirst) 
     14stdoutSecond = utf.strip_android_debug_messages(rawstdoutSecond) 
    1115 
    1216if stderrFirst != stderrSecond or stdoutFirst != stdoutSecond: