# HG changeset patch # User Jeff Hammel # Date 1375223784 25200 # Node ID a5d058957734b48f5846a1d129e3c078ec74bc40 # Parent 9033a5f11b9240ce777a83a279434993c74c0fae wip diff -r 9033a5f11b92 -r a5d058957734 makeitso/python.py --- a/makeitso/python.py Tue Jul 30 15:29:56 2013 -0700 +++ b/makeitso/python.py Tue Jul 30 15:36:24 2013 -0700 @@ -33,8 +33,8 @@ Variable('repo', 'project repository'), ] - def path2name(self, path): - return os.path.basename(path.rstrip(os.path.sep)) + def output2name(self, path): + return os.path.splitext(os.path.basename(path.rstrip(os.path.sep)))[0] class PythonScriptTemplate(PythonTemplate): """template for a single python script""" @@ -50,7 +50,7 @@ look = False def pre(self, variables, output): - variables['module'] = variables['main'] = path2name(output) + variables['module'] = variables['main'] = self.output2name(output) class PythonPackageTemplate(PythonTemplate): """ @@ -84,7 +84,7 @@ """ # get project from output directory - variables['project'] = self.path2name(output) + variables['project'] = self.output2name(output) # get package name from project # XXX could have looser restrictions with transforms diff -r 9033a5f11b92 -r a5d058957734 makeitso/python_package/{{package}}/{{main}}.py --- a/makeitso/python_package/{{package}}/{{main}}.py Tue Jul 30 15:29:56 2013 -0700 +++ b/makeitso/python_package/{{package}}/{{main}}.py Tue Jul 30 15:36:24 2013 -0700 @@ -11,7 +11,7 @@ import sys def add_options(parser): - """add {{package}} options to an OptionParser instance""" + """add options to the OptionParser instance""" def main(args=sys.argv[1:]):