예제 #1
0
def do_flora_completer_update(self, arg):
    """Update the tab-completer — load a file with known tokens / compound functions"""
    from rpsimple import format_flr
    if hasattr(self, 'flora_completer_file'):
        self.flora_completer_listing = open(self.flora_completer_file, 'r').readlines()
    else:
        self.flora_instance.query('_save(completion).')
        self.flora_completer_listing = format_flr('completion.flr', writeback=False)
        import os
        os.remove('completion.flr')
    return self.flora_completer_listing
예제 #2
0
def do_flora_save(self, arg):
    """save main-module to file"""
    assert len(arg.split()) == 1, 'Expects exactly one argument: filename'
    self.flora_instance.query('_save(' + arg + ').')
    from rpsimple import format_flr
    return format_flr(arg + '.flr', writeback=True)