changeset 161:a5d058957734

wip
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 30 Jul 2013 15:36:24 -0700
parents 9033a5f11b92
children 1a419ebe0fe5
files makeitso/python.py makeitso/python_package/{{package}}/{{main}}.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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:]):