Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added commandor res to command

  • Loading branch information...
commit 5fbb9eb89cbb3817eb90580022613afb8f6dfd49 1 parent f310cb0
@Lispython authored
View
4 ChangeLog
@@ -1,6 +1,10 @@
Fab Magic Changelog
====================
+# v0.08 (8-12-2012)
+
+- Added commandor res to command
+
# v0.0.6 (8-12-2012)
- Added more test
View
4 commandor/__init__.py
@@ -17,8 +17,8 @@
__author__ = "Alex Lispython (alex@obout.ru)"
__license__ = "BSD, see LICENSE for more details"
-__version_info__ = (0, 0, 7)
-__build__ = 0x000007
+__version_info__ = (0, 0, 8)
+__build__ = 0x000008
__version__ = ".".join(map(str, __version_info__))
__maintainer__ = "Alexandr Lispython (alex@obout.ru)"
View
5 commandor/base.py
@@ -177,7 +177,7 @@ def process(self):
return res
command, args = self.__class__.find_command(commands_args)
- command_instance = command(cur_dir=self._curdir, args=args)
+ command_instance = command(cur_dir=self._curdir, args=args, commandor_res=res)
return command_instance.process()
@classmethod
@@ -240,10 +240,11 @@ class Command(Mixin):
help = None
- def __init__(self, parser=None, args=[], cur_dir=None):
+ def __init__(self, parser=None, args=[], cur_dir=None, commandor_res=None):
self._args = args
self.parser = parser
self._cur_dir = cur_dir
+ self._commandor_res = commandor_res
def initialize_parser(self):
"""Create :class:`optparse.OptionParse`
View
2  setup.py
@@ -25,7 +25,7 @@
print(e)
readme_content = __doc__
-VERSION = "0.0.7"
+VERSION = "0.0.8"
py_ver = sys.version_info
View
4 tests/core.py
@@ -109,7 +109,7 @@ def run(self, options, args):
else:
test_self.assertEquals(options.config, "./config.py")
self.test_commandor = True
- return "commandor_name"
+ return {"param": "value1"}
class Server(Command):
"""Command description
@@ -119,6 +119,7 @@ class Server(Command):
def run(self, options, args):
test_self.assertFalse(self.test_server)
+ test_self.assertEquals(self._commandor_res['param'], "value1")
return "server_name"
class Start(Command):
@@ -130,6 +131,7 @@ def run(self, verbose, processes):
test_self.assertTrue(verbose)
test_self.assertEquals(processes, 10)
test_self.assertFalse(self.test_start)
+ test_self.assertEquals(self._commandor_res['param'], "value1")
return "start_name"
parser = OptionParser(
Please sign in to comment.
Something went wrong with that request. Please try again.