wonkodv / hanstool

A shell-like python frontend with various user interfaces
Other
0 stars 0 forks source link

cmd(when) #2

Closed ujeropoc closed 8 years ago

ujeropoc commented 8 years ago

cmd(when=not ('win' in Filter.os or 'ht3.cli' in Filter.frontend))

ht3.lib loads ht3.filter very early

ht3.Filter has

os: ['unix','linux'] or ['windows','windows vista'] arch: ['arm','arm7-m'] or ['x86','32bit'] frontend = ['ht3.cli',ht3.hotkey']

Frontends set Env.Filter.front to module.qualname early

Scripts can raise a NotImplemented Exception if they want to filter out the whole script.

wonkodv commented 8 years ago
if ht3.lib.Check.os.win or ht3.lib.Check.frontend('ht3.cli')
    @cmd
    def ...