Restore old packp3d behavior: main file should be considered relative to -d directory

This commit is contained in:
rdb 2015-08-06 15:49:26 +02:00
parent 0e6092004d
commit b50fbe8263
1 changed files with 7 additions and 6 deletions

View File

@ -170,19 +170,20 @@ def makePackedApp(args):
appDir = Filename('.')
appBase = appFilename.getBasenameWoExtension()
if not main:
if main:
main = Filename.fromOsSpecific(main)
main.makeAbsolute(root)
else:
main = Filename(root, 'main.py')
if main.exists():
main = 'main.py'
else:
if not main.exists():
main = glob.glob(os.path.join(root.toOsSpecific(), '*.py'))
if len(main) == 0:
raise ArgumentError, 'No Python files in root directory.'
elif len(main) > 1:
raise ArgumentError, 'Multiple Python files in root directory; specify the main application with -m "main".'
main = os.path.split(main[0])[1]
main = Filename.fromOsSpecific(main)
main = Filename.fromOsSpecific(os.path.split(main[0])[1])
main.makeAbsolute(root)
packager.installDir = appDir
packager.allowPythonDev = allowPythonDev