aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-08-05 18:24:01 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-08 17:44:00 -0400
commitd548eb594b0f666a799ee3654ad076517a630a32 (patch)
treed4dd3b323598813feac7530b402631fe245fb336
parent40813d95563efe18debd231676c90d7d3bd47910 (diff)
downloadcbc-d548eb594b0f666a799ee3654ad076517a630a32.tar.gz
Fix missing main()
-rw-r--r--cbc/cli/recipe.py6
-rw-r--r--setup.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/cbc/cli/recipe.py b/cbc/cli/recipe.py
index b9a58b5..8fabe2f 100644
--- a/cbc/cli/recipe.py
+++ b/cbc/cli/recipe.py
@@ -10,7 +10,7 @@ RECIPE_TYPES = ['python',
'scons',
'cmake']
-if __name__ == '__main__':
+def main():
parser = argparse.ArgumentParser()
parser.add_argument('--style', default='python')
parser.add_argument('--name', default='')
@@ -161,3 +161,7 @@ if errorlevel 1 exit 1
with open(RECIPE, 'w+') as recipe:
config.write(recipe)
+
+if __name__ == '__main__':
+ main()
+
diff --git a/setup.py b/setup.py
index f45cf30..8bf8cc4 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,9 @@ cbcpkg = os.path.join('cbc', 'version.py')
#Omit git hash and let setuptools add a valid build number
git_version = get_git_version()
-git_version = git_version[:git_version.rfind('-')]
+if git_version.rfind('-') != -1:
+ git_version = git_version[:git_version.rfind('-')]
+
with open(cbcpkg, 'w+') as version_data:
version_data.write('__version__ = "{0}"\n'.format(git_version))