Example #1
0
def main():
    note_items = []
    for note in [
            'domain &controller!', 'database!', '&using', 'keylogger',
            'screenshotter', 'standby', 'sandbox', 'do not use', 'sysadmin',
            '!!!'
    ]:
        note_items.append(
            gui.item(note,
                     callback=(lambda note: lambda bids: setNotes(
                         bids, note.replace('&', '')))(note)))

    note_items.append(gui.separator())
    note_items.append(
        gui.item('&clear', callback=lambda bids: setNotes(bids, '')))

    menu = gui.popup('beacon_bottom',
                     children=[gui.menu('&Note', children=note_items)])

    gui.register(menu)

    engine.loop()
Example #2
0
    except RuntimeError as e:
        engine.error('SharpGen failed. See above for more details.')


# Compile C# code from file using SharpGen
@commands.command('sharpgen-compile-file')
def _(source, out=None, *sharpgen_flags):
    engine.message('Compiling C# code from: {}'.format(source))
    try:
        out, from_cache = sharpgen.compile_file(
            source, out=out, additional_options=sharpgen_flags)

        if from_cache:
            engine.message(
                'Build was found in the cache! Output is in: {}'.format(out))
        else:
            engine.message(
                'Build was successful! Output is in: {}'.format(out))
    except RuntimeError as e:
        engine.error('SharpGen failed. See above for more details.')


# Clear the SharpGen build cache
@commands.command('sharpgen-clear-cache')
def _():
    sharpgen.clear_cache()
    engine.message('Cleared the SharpGen build cache')


engine.loop()