Mercurial > python-cmd2
comparison cmd2.py @ 226:a64555659169
synch
author | catherine@dellzilla |
---|---|
date | Mon, 23 Mar 2009 09:57:01 -0400 |
parents | 061db156c99f |
children | fea183146819 |
comparison
equal
deleted
inserted
replaced
225:061db156c99f | 226:a64555659169 |
---|---|
878 urlre = re.compile('(https?://[-\\w\\./]+)') | 878 urlre = re.compile('(https?://[-\\w\\./]+)') |
879 def do_load(self, fname=None): | 879 def do_load(self, fname=None): |
880 """Runs script of command(s) from a file or URL.""" | 880 """Runs script of command(s) from a file or URL.""" |
881 if fname is None: | 881 if fname is None: |
882 fname = self.default_file_name | 882 fname = self.default_file_name |
883 #keepstate = Statekeeper(self, ('stdin','use_rawinput','prompt','continuation_prompt')) | 883 keepstate = Statekeeper(self, ('stdin','use_rawinput','prompt','continuation_prompt')) |
884 keepstate = Statekeeper(self, ('stdin','use_rawinput','continuation_prompt')) | |
885 try: | 884 try: |
886 if isinstance(fname, file): | 885 if isinstance(fname, file): |
887 target = open(fname, 'r') | 886 target = open(fname, 'r') |
888 else: | 887 else: |
889 match = self.urlre.match(fname) | 888 match = self.urlre.match(fname) |