Commit 2b54a06c authored by Jim Fulton's avatar Jim Fulton

Changed to generate nicer-reading and less dynamic scripts.

parent 0e313b1e
...@@ -22,7 +22,6 @@ assist in custom script generation. ...@@ -22,7 +22,6 @@ assist in custom script generation.
$Id$ $Id$
""" """
# XXX needs doctest
# XXX need to deal with extras # XXX need to deal with extras
import os import os
...@@ -88,7 +87,7 @@ def _script(dist, group, name, path, dest): ...@@ -88,7 +87,7 @@ def _script(dist, group, name, path, dest):
project = dist.project_name, project = dist.project_name,
name = name, name = name,
module_name = entry_point.module_name, module_name = entry_point.module_name,
attrs = entry_point.attrs, attrs = '.'.join(entry_point.attrs),
)) ))
try: try:
os.chmod(dest, 0755) os.chmod(dest, 0755)
...@@ -103,19 +102,10 @@ sys.path[0:0] = [ ...@@ -103,19 +102,10 @@ sys.path[0:0] = [
'%(path)s' '%(path)s'
] ]
import %(module_name)s
module = __import__(%(module_name)r, globals(),globals(), ['__name__'])
attrs = %(attrs)r
entry = module
for attr in attrs:
try:
entry = getattr(entry, attr)
except AttributeError:
raise ImportError("%%r has no %%r attribute" %% (module, attrs))
if __name__ == '__main__': if __name__ == '__main__':
entry() %(module_name)s.%(attrs)s()
''' '''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment