diff makeitso/python.py @ 177:c3f719824948

more allowable
author Jeff Hammel <k0scist@gmail.com>
date Fri, 24 Jan 2014 11:03:05 -0800
parents 54f42aa651bc
children d6ef91d49609
line wrap: on
line diff
--- a/makeitso/python.py	Thu Jan 16 15:44:31 2014 -0800
+++ b/makeitso/python.py	Fri Jan 24 11:03:05 2014 -0800
@@ -20,6 +20,7 @@
 
 import os
 import shutil
+import string
 import sys
 from cli import MakeItSoCLI
 from makeitso import ContentTemplate
@@ -97,8 +98,9 @@
     variables['project'] = self.output2name(output)
 
     # get package name from project
-    # XXX could have looser restrictions with transforms
-    assert variables['project'].isalnum(), 'Project name must be just letters, you gave %s' % variables['project']
+    allowable = set(string.letters + string.digits + '_')
+    if not set(variables['project']).issubset(allowable):
+        raise AssertionError("Illegal fields in package name")
     variables['package'] = variables['project'].lower()
 
     # name of CLI main file