From b2a3444cc2dc1a6ab8ddb7ee198113d4155019a7 Mon Sep 17 00:00:00 2001 From: jim <jim@62d5b8a3-27da-0310-9561-8e5933582275> Date: Fri, 9 Jun 2006 21:32:28 +0000 Subject: [PATCH] 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 --- src/zc/buildout/egglinker.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/zc/buildout/egglinker.py b/src/zc/buildout/egglinker.py index 9fa95bb7..9690885c 100644 --- a/src/zc/buildout/egglinker.py +++ b/src/zc/buildout/egglinker.py @@ -22,7 +22,6 @@ assist in custom script generation. $Id$ """ -# XXX needs doctest # XXX need to deal with extras import os @@ -88,7 +87,7 @@ def _script(dist, group, name, path, dest): project = dist.project_name, name = name, module_name = entry_point.module_name, - attrs = entry_point.attrs, + attrs = '.'.join(entry_point.attrs), )) try: os.chmod(dest, 0755) @@ -103,19 +102,10 @@ sys.path[0:0] = [ '%(path)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)) +import %(module_name)s if __name__ == '__main__': - entry() + %(module_name)s.%(attrs)s() ''' -- 2.30.9