Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[update-app] improved development note

Signed-off-by: Hank Wang <hank@openmoko.com>
  • Loading branch information...
commit 026e04b7fbdbcde9f8247b2f31629e6d3e14d4b2 1 parent cba7429
Hank Wang authored
View
63 update-app/README.md
@@ -1,8 +1,28 @@
-# WikiReader
-## Package Note
+# WikiReader Development Note
+
+### Package list
+
+* Python 2.7.3
+* wxPython (2.9.3.1 on OSX, 2.8.12.1 on Windows)
+* py2app 0.6.4 (for OSX)
+
+### Check packages version
+
+```
+$ python --version
+Python 2.7.3
+
+$ python
+>>> import wx
+>>> import wx.__version__
+'2.9.3.1'
+```
+
### Windows
+**Use Pyinstaller to generate exe file on Windows.**
+
[Pyinstaller - pack applcation to exe](http://www.pyinstaller.org/)
```
@@ -10,31 +30,33 @@ python Makespec.py -F -w --icon=icon.ico "WikiReader Update.py"
python Build.py .\WikiReader Update\WikiReader Update.spec
```
-### Mac
+Important: Add 7za path to spec.
+
+```
+a.datas += [('7za.exe', 'C:\\wikireaderPlus\\tools\\7za.exe', 'DATA')]
+```
+
+### OSX
**py2app - Create standalone Mac OS X applications with Python**
```
pip install py2app
-./build.sh
+./buildMacApp.sh
```
-run **build.sh** to simple package the app.
+run **buildMacApp.sh** to simple deploy the app.
-### Ubuntu Linux
-sudo apt-get install gtk2-engines-pixbuf
-sudo apt-get install python-wxgtk2.8
-sudo apt-get install python-wxtools
+## OSX : Code Sign for Mountain Lion
-## Mac : Code Sign for ML
+**Enable/Disable Gatekeeper**
-disable
+```
sudo spctl --master-disable
+```
-[Sign for Gatekeeper](http://web.archiveorange.com/archive/v/cW70Ll4ViLCVNwKOE3gl)
-
-Download Mac Developer then install to keychain
+Download Mac Developer code sign then install to keychain
```
codesign -f -s "Developer ID Application" dist/WikiReader.app/
@@ -42,10 +64,15 @@ codesign -f -s "Developer ID Application" dist/WikiReader.app/
spctl -a -v dist/WikiReader.app
```
-#### Refernce
+[Sign for Gatekeeper](http://web.archiveorange.com/archive/v/cW70Ll4ViLCVNwKOE3gl)
+
+#### Reference
+
+[Mac Developer - Distributing Outside the Mac App Store](
+http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/OSXWorkflowGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html)
+
+[Mac Developer - Code Signing Tasks](https://developer.apple.com/library/mac/#documentation/security/Conceptual/CodeSigningGuide/Procedures/Procedures.html)
-http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/OSXWorkflowGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html
+[Developer ID Gotcha](http://www.red-sweater.com/blog/2390/developer-id-gotcha)
-https://developer.apple.com/library/mac/#documentation/security/Conceptual/CodeSigningGuide/Procedures/Procedures.html
-http://www.red-sweater.com/blog/2390/developer-id-gotcha
View
20 update-app/Wikireader Update.py
@@ -1,6 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+"""
+WikiReader update app - Main program
+"""
+
import sys, os
import wx
import wx.lib.mixins.listctrl as listmix
@@ -13,21 +17,23 @@
import disk
import download
import images
-import logging
+
+## Debug for deploy version
+#import logging
# logger = logging.getLogger('WikiReader')
# hdlr = logging.FileHandler('/var/tmp/WikiReader.log')
# formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
# hdlr.setFormatter(formatter)
# logger.addHandler(hdlr)
# logger.setLevel(logging.INFO)
-#logger.info('test')
+# logger.info('test')
# stuff for debugging
-print "Python", sys.version
-print "wx.version:", wx.version()
-print "pid:", os.getpid()
+#print "Python", sys.version
+#print "wx.version:", wx.version()
+#print "pid:", os.getpid()
#print "uname:", os.uname()
-print "platform:", wx.Platform
+#print "platform:", wx.Platform
kPackages = None
checkedItems = []
@@ -834,7 +840,7 @@ def checkingVersionDialog(parent, showError=True):
if not version:
version = '0000.00.00'
- print version
+ #print version
if len(disk.getMountList()) < 1 and showError:
wx.MessageBox('We don\'t detected any sdcard on your computer', 'Info', wx.OK | wx.ICON_INFORMATION)
View
2  update-app/disk.py
@@ -13,8 +13,6 @@
import subprocess
from Utilities import resource_path
-#from commands import getoutput
-#print getoutput('df -h')
tmpDirName = '/wikireader'
downloadDirName = '/Download'
View
6 update-app/generateImages.py
@@ -1,3 +1,9 @@
+"""
+Generate all imgs to python binary file.
+img2py command required.
+$ python generateImages.py
+"""
+
from commands import getoutput
import os
from Utilities import getProgramFolder
View
4 update-app/winapi.py
@@ -1,3 +1,7 @@
+"""
+This API only for MSW(Windows) version.
+"""
+
import wmi
c = wmi.WMI()
Please sign in to comment.
Something went wrong with that request. Please try again.