changeset 177:c3f719824948

more allowable
author Jeff Hammel <k0scist@gmail.com>
date Fri, 24 Jan 2014 11:03:05 -0800
parents 668b01d04457
children d6ef91d49609
files makeitso/python.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
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