comparison makeitso/python.py @ 238:a1a615aae3d1

dont give up so easily
author Jeff Hammel <k0scist@gmail.com>
date Thu, 21 Jan 2016 09:48:14 -0800
parents 65684aae6bfe
children cab05bfc59ab
comparison
equal deleted inserted replaced
237:70b5410e4ede 238:a1a615aae3d1
111 # get project from output directory 111 # get project from output directory
112 variables['project'] = self.output2name(output) 112 variables['project'] = self.output2name(output)
113 113
114 # get package name from project 114 # get package name from project
115 allowable = set(string.letters + string.digits + '_') 115 allowable = set(string.letters + string.digits + '_')
116 if not set(variables['project']).issubset(allowable): 116 package = variables['project'].lower()
117 raise AssertionError("Illegal fields in package name") 117 package = ''.join([c for c in package
118 variables['package'] = variables['project'].lower() 118 if c in allowallable])
119 # TODO better: translation matrix
120 variables['package'] = package
119 121
120 # name of CLI main file 122 # name of CLI main file
121 variables['main'] = 'main' 123 variables['main'] = 'main'
122 124
123 # package dependencies 125 # package dependencies