]> git.nothing2do.fr Git - get-hack-src.git/commitdiff
Added additional version and banner commands
authorallfro <ndouba@gmail.com>
Tue, 19 Mar 2013 23:42:34 +0000 (19:42 -0400)
committerallfro <ndouba@gmail.com>
Tue, 19 Mar 2013 23:42:34 +0000 (19:42 -0400)
src/canari/commands/__init__.py
src/canari/commands/banner.py [new file with mode: 0644]
src/canari/commands/common.py
src/canari/commands/create_package.py
src/canari/commands/version.py [new file with mode: 0644]

index 19ea9546e0caa76f9057548329682d7f162cfd69..bc9b245ee9b3d2982f2f64ec7365083c7dba8eaa 100644 (file)
@@ -26,5 +26,7 @@ __all__ = [
     'rename_transform',
     'list_commands',
     'run_server',
-    'generate_entities'
+    'generate_entities',
+    'version',
+    'banner'
 ]
\ No newline at end of file
diff --git a/src/canari/commands/banner.py b/src/canari/commands/banner.py
new file mode 100644 (file)
index 0000000..e24f1ba
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+from common import get_commands, cmd_name
+from argparse import ArgumentParser
+from sys import modules
+
+import canari
+
+
+__author__ = 'Nadeem Douba'
+__copyright__ = 'Copyright 2012, Canari Project'
+__credits__ = []
+
+__license__ = 'GPL'
+__version__ = '0.1'
+__maintainer__ = 'Nadeem Douba'
+__email__ = 'ndouba@gmail.com'
+__status__ = 'Development'
+
+
+parser = ArgumentParser(
+    description='Show banner of Canari framework that is currently active.',
+    usage='canari %s' % cmd_name(__name__)
+)
+
+
+def help():
+    parser.print_help()
+
+
+def description():
+    return parser.description
+
+
+def run(args):
+    print """
+    Your running ...
+_________                           _____          _______  _______
+__  ____/_____ _____________ __________(_)  ___   ___  __ \ __( __ )
+_  /    _  __ `/_  __ \  __ `/_  ___/_  /   __ | / /  / / / _  __  |
+/ /___  / /_/ /_  / / / /_/ /_  /   _  /    __ |/ // /_/ /__/ /_/ /
+\____/  \__,_/ /_/ /_/\__,_/ /_/    /_/     _____/ \____/_(_)____/
+
+                                ... http://canariproject.com
+                                                                        """
\ No newline at end of file
index 8c213e2df737dc82265d9e10fc662173ca2e5450..01270414c0b0499081e35eb1352a94ad35b6f835 100644 (file)
@@ -1,21 +1,30 @@
 #!/usr/bin/env python
 
-import os
-import subprocess
-import sys
-import unicodedata
-from canari.utils.fs import fmutex
-
+from distutils.command.install import install
 from pkg_resources import resource_filename
 from distutils.dist import Distribution
-from distutils.command.install import install
 from datetime import datetime
 from string import Template
+import unicodedata
+import subprocess
+import threading
+import sys
+import os
+
 
 from canari.config import CanariConfigParser
-import threading
 
 
+__author__ = 'Nadeem Douba'
+__copyright__ = 'Copyright 2012, Canari Project'
+__credits__ = []
+
+__license__ = 'GPL'
+__version__ = '0.3'
+__maintainer__ = 'Nadeem Douba'
+__email__ = 'ndouba@gmail.com'
+__status__ = 'Development'
+
 
 def synchronized(func):
 
@@ -27,15 +36,6 @@ def synchronized(func):
 
     return synced_func
 
-__author__ = 'Nadeem Douba'
-__copyright__ = 'Copyright 2012, Canari Project'
-__credits__ = []
-
-__license__ = 'GPL'
-__version__ = '0.2'
-__maintainer__ = 'Nadeem Douba'
-__email__ = 'ndouba@gmail.com'
-__status__ = 'Development'
 
 def fix_etree():
     try:
index 2bcb2eda102abcca9783552ad035548f793fe916..d9e054cefe9ccb7ba8e7c39215d001a063ac1105 100644 (file)
@@ -1,19 +1,20 @@
 #!/usr/bin/env python
 
-from common import read_template, write_template, generate_all, build_skeleton, cmd_name, parse_bool
-
 from argparse import ArgumentParser
 from datetime import datetime
 from getpass import getuser
 from os import path
 
+from common import read_template, write_template, generate_all, build_skeleton, cmd_name, parse_bool
+import canari
+
 
 __author__ = 'Nadeem Douba'
 __copyright__ = 'Copyright 2012, Canari Project'
 __credits__ = []
 
 __license__ = 'GPL'
-__version__ = '0.5'
+__version__ = '0.6'
 __maintainer__ = 'Nadeem Douba'
 __email__ = 'ndouba@gmail.com'
 __status__ = 'Development'
@@ -150,7 +151,7 @@ def run(args):
         'maintainer' : getuser(),
         'example' : True,
         'description' : '',
-        'canari_version' : __version__
+        'canari_version' : canari.__version__
     }
 
     ask_user(values)
diff --git a/src/canari/commands/version.py b/src/canari/commands/version.py
new file mode 100644 (file)
index 0000000..d50e258
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+from common import get_commands, cmd_name
+from argparse import ArgumentParser
+from sys import modules
+
+import canari
+
+
+__author__ = 'Nadeem Douba'
+__copyright__ = 'Copyright 2012, Canari Project'
+__credits__ = []
+
+__license__ = 'GPL'
+__version__ = '0.1'
+__maintainer__ = 'Nadeem Douba'
+__email__ = 'ndouba@gmail.com'
+__status__ = 'Development'
+
+
+parser = ArgumentParser(
+    description='Show version of Canari framework that is currently active.',
+    usage='canari %s' % cmd_name(__name__)
+)
+
+
+def help():
+    parser.print_help()
+
+
+def description():
+    return parser.description
+
+
+def run(args):
+    print 'Your running *Canari Framework v%s*' % canari.__version__
\ No newline at end of file