Mercurial > code > home > repos > light9
view flax/add_sub @ 255:6f6d9235e8a0
TkGyro added to gyrocontroller, seems mostly functional
Some bugs that still need to be fixed:
- It refuses to go full screen on my machine.
- Text in the middle can catch some events, we'd like it to pass them to
the rectangles under it.
author | David McClosky <dmcc@bigasterisk.com> |
---|---|
date | Wed, 15 Jun 2005 20:33:05 +0000 |
parents | 3905d3c92aaa |
children |
line wrap: on
line source
#!/usr/bin/env python # usage: add_sub [-l sublevel] subname subterms_to_add_to from optparse import OptionParser parser = OptionParser() parser.add_option('-l', '--level', default='0') opts, args = parser.parse_args() print 'debug', opts, args sub = args.pop(0) print "adding '%s' at %s" % (sub, opts.level) for subterm in args: print "subterm", subterm print filename = 'subterms/%s' % subterm subs = [line.split(None, 1)[0] for line in file(filename).readlines()] if sub not in subs: f = file(filename, 'a') print 'appended!' print >>f, "%s %s" % (sub, opts.level)