Permalink
Browse files

Deduplicate version into octogit.__version__

Also, running 'octogit' shows help along with author/version from show_boating
  • Loading branch information...
1 parent 39e77e2 commit 3947961fd450069bd91d748b44f1477fa19241da @dbr committed Apr 25, 2012
Showing with 18 additions and 10 deletions.
  1. +1 −0 octogit/__init__.py
  2. +13 −9 octogit/cli.py
  3. +4 −1 setup.py
View
@@ -0,0 +1 @@
+__version__ = (0, 1, 3)
View
@@ -18,8 +18,18 @@
from .config import login, create_config, commit_changes, CONFIG_FILE
+def version():
+ from . import __version__
+ return ".".join(str(x) for x in __version__)
+
+
def get_help():
- puts('{0}.'.format(colored.blue('octogit')))
+ puts('{0}. version {1} by Mahdi Yusuf {2}'.format(
+ colored.blue('octogit'),
+ version(),
+ colored.green('@myusuf3')))
+ puts('{0}: http://github.com/myusuf3/octogit'.format(colored.yellow('source')))
+
puts('\n{0}:'.format(colored.cyan('tentacles')))
with indent(4):
puts(colored.green('octogit login'))
@@ -32,12 +42,6 @@ def get_help():
puts(colored.green('octogit status'))
puts('\n')
-def show_boating():
- puts('{0}. version 0.1.3 by Mahdi Yusuf {1}'.format(colored.blue('octogit'), colored.green('@myusuf3')))
- puts('{0}: http://github.com/myusuf3/octogit'.format(colored.yellow('source')))
-
-def version():
- show_boating()
def git_status():
print git.status()
@@ -84,11 +88,11 @@ def begin():
commit_changes()
if args.flags.contains(('--version', '-v')):
- version()
+ puts(version())
sys.exit(0)
elif args.get(0) == None:
- show_boating()
+ get_help()
elif args.get(0) == 'status':
git_status()
View
@@ -9,6 +9,9 @@
from distutils.core import setup
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+from octogit import __version__
+
def publish():
os.system("python setup.py sdist upload")
@@ -38,7 +41,7 @@ def publish():
setup(
name='octogit',
- version='0.1.3',
+ version=".".join(str(x) for x in __version__),
description='giving git tentacles to work better with github',
url='https://github.com/myusuf3/octogit',
author='Mahdi Yusuf',

0 comments on commit 3947961

Please sign in to comment.