Changeset 334 in tailor for vcpx/session.py


Ignore:
Timestamp:
05/25/05 23:41:52 (8 years ago)
Author:
lele@…
Hash name:
20050525214152-97f81-bb30c6580e192257ba341cd3c3521812541c7fff
Message:

Allow comments, removing anything after the first '#' on the command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/session.py

    r333 r334  
    100100        """Override the default impl of reexecuting last command.""" 
    101101        pass 
     102 
     103    def precmd(self, line): 
     104        """Strip anything after the first '#', to allow comments.""" 
     105 
     106        try: 
     107            line = line[:line.index('#')] 
     108        except ValueError: 
     109            pass 
     110 
     111        return line 
    102112         
    103113    def do_exit(self, arg): 
Note: See TracChangeset for help on using the changeset viewer.