Commit b2a3444c authored by jim's avatar jim

Changed to generate nicer-reading and less dynamic scripts.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@68553 62d5b8a3-27da-0310-9561-8e5933582275
parent d8e79759
...@@ -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