[Pythonmac-SIG] macho_standalone progress: how to call -archs from command line?
Kevin Walzer
kw at kevin-walzer.com
Thu Apr 20 18:02:00 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I had written a few days ago about getting this error when I try to run
the latest macho_standalone on an app bundle in this fashion:
macho_standalone ~/Desktop/Myapp.app:
File
"/Library/Frameworks/Python.framework/Versions/Current/bin/macho_standalone",
line 20, in ?
main()
File
"/Library/Frameworks/Python.framework/Versions/Current/bin/macho_standalone",
line 17, in main
standaloneApp(fn)
File
"/Library/Frameworks/Python.framework/Versions/Current/bin/macho_standalone",
line 10, in standaloneApp
files = MachOStandalone(path).run()
TypeError: __init__() takes at least 3 arguments (2 given)
Digging a bit deeper into the macholib code, I noted that
MachOStandalone.py calls for an "archs" argument:
class MachOStandalone(object):
def __init__(self, base, archs, dest=None, graph=None, env=None,
executable_path=None):
self.base = os.path.join(os.path.abspath(base), '')
if dest is None:
dest = os.path.join(self.base, 'Contents', 'Frameworks')
self.dest = dest
self.mms = dict([[arch, FilteredMachOGraph(self, arch,
graph=graph, env=env, executable_path=executable_path)] for arch in archs])
self.changemap = {}
self.excludes = []
self.pending = deque()
self.archs = archs
So what I'm trying to figure out is how to correctly pass the "archs"
argument in my command-line parameters. I've tried four variants:
macho_standalone ~/Desktop/Myapp.app ppc
macho_standalone ~/Desktop/Myapp.app "archs = 'ppc'"
macho_standalone ~/Desktop/Myapp.app "archs = ['ppc']"
macho_standalone ~/Desktop/Myapp.app -archs ppc
All of these yield the same error message as above.
I think I'm on the right track here, because when I hard-code the ppc
architecture in the __init__ def above, macho_standalone works.
def __init__(self, base, archs=['ppc'], dest=None, graph=None,
env=None, executable_path=None):
So what I need to do is find the correct magic to get the command-line
args invoked properly. Does anyone have any suggestions?
Thanks!
- --
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFER7B4rTC5hIgjqTMRAoeZAJ9+Qt+6ggPfZhW++Hqn3JankmwTBgCeKz7Q
Jlmo6RkuKDnizVoUDzjhMeo=
=Vd/V
-----END PGP SIGNATURE-----
More information about the Pythonmac-SIG
mailing list