Changeset 274


Ignore:
Timestamp:
Oct 20, 2011, 1:51:23 PM (6 years ago)
Author:
guillaume
Message:

[feat] process docstring

Location:
reblok/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • reblok/trunk/reblok/reblok.py

    r271 r274  
    182182        ### VARIABLE SET ###
    183183        def do_set(self, instr, **kwargs):
    184                 self._print("%s = %s" % (self._dispatch(instr[1], noprint=True), self._dispatch(instr[2], noprint=True)))
     184                target = self._dispatch(instr[1], noprint=True)
     185                # docstring
     186                if target == '__doc__':
     187                        self._print("\"\"\"%s\"\"\"" % self._dispatch(instr[2], noprint=True)[1:-1].replace('\\n','\n'))
     188                else:
     189                        self._print("%s = %s" % (target, self._dispatch(instr[2], noprint=True)))
    185190
    186191        ### RETURN ### 
Note: See TracChangeset for help on using the changeset viewer.