ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pythonmac-sig
pythonmac-sig
[Pythonmac-SIG] macho_standalone progress: how to call -archs from command line?
by Kevin Walzer other posts by this author
Apr 20 2006 9:02AM messages near this date
Re: [Pythonmac-SIG] Latest universal build is 404 | Re: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 36, Issue 60
-----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-----
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@[...].org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved