Browse files

Add reload command.

  • Loading branch information...
1 parent 27d8226 commit 771d44af1ed7f79a8eaab5aefd43f3f65c4601cf @niwinz niwinz committed May 11, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 restshlib/restcmd.py
View
9 restshlib/restcmd.py
@@ -8,9 +8,10 @@
import getpass
import sys
import cmd
+import imp
import shlex
-from .restshlib import RestSHLib
+from . import restshlib
DEBUG = False
@@ -40,7 +41,7 @@ class RestSH(cmd.Cmd, object):
cfg_prompt = "%(login)s@%(baseurl)s|restsh> "
def __init__(self, *args, **kwargs):
- self.restshlib = RestSHLib()
+ self.restshlib = restshlib.RestSHLib()
self.prompt = self.cfg_prompt % {"login": self.login, "baseurl": self.baseurl}
super(RestSH, self).__init__(*args, **kwargs)
@@ -69,6 +70,10 @@ def _print_response(self, response):
if self.restshlib.settings.get('print_status', "1") in ["1","yes","true"]:
print("Status Code: {0}".format(response.status_code))
+ def do_reload(self, params):
+ imp.reload(restshlib)
+ self.restshlib = restshlib.RestSHLib()
+
def do_help(self, params):
'''Show help information. Example: help set'''
if params:

0 comments on commit 771d44a

Please sign in to comment.