Skip to content

Commit

Permalink
Always search certificates in script directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ma1co committed Apr 2, 2016
1 parent eb84d85 commit cd09e60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pmca.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from pmca.usb.driver import *
from pmca.usb.sony import *

scriptRoot = getattr(sys, '_MEIPASS', os.path.dirname(__file__))

def printStatus(status):
"""Print progress"""
print '%s %d%%' % (status.message, status.percent)
Expand All @@ -25,7 +27,7 @@ def switchToAppInstaller(dev):
print 'Switching to app install mode. Please run this command again when the camera has switched modes.'
SonyExtCmdCamera(dev).switchToAppInstaller()

defaultCertFile = getattr(sys, '_MEIPASS', 'certs') + '/localtest.me.pem'
defaultCertFile = scriptRoot + '/certs/localtest.me.pem'
def installApp(dev, host=None, apkFile=None, outFile=None, certFile=defaultCertFile):
"""Installs an app on the specified device."""
apkData = apkFile.read() if apkFile else None
Expand Down
4 changes: 2 additions & 2 deletions pmca.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ suffix = {'linux2': '-linux', 'win32': '-win', 'darwin': '-osx'}
output = 'pmca-' + subprocess.check_output(['git', 'describe', '--always', '--tags']).strip() + suffix.get(sys.platform, '')

# Analyze files
a = Analysis(['pmca.py'], excludes=['numpy'], datas=[('certs/*.pem', '.')])# Don't let comtypes include numpy
a.binaries = [(os.path.basename(name), path, type) for name, path, type in a.binaries]# libusb binaries are not found in subdirs
a = Analysis(['pmca.py'], excludes=['numpy'], datas=[('certs/*', 'certs')])# Don't let comtypes include numpy
a.binaries = [((os.path.basename(name) if type == 'BINARY' else name), path, type) for name, path, type in a.binaries]# libusb binaries are not found in subdirs

# Generate executable
pyz = PYZ(a.pure, a.zipped_data)
Expand Down

0 comments on commit cd09e60

Please sign in to comment.