Esempio n. 1
0
#!/usr/bin/python
import sys
from patchfinder import PatchFinder
import os
import urwid
import urllib
import tempfile

html = False
args = sys.argv[1:]
if args[0] == "--html":
	html = True
	args = args[1:]

pf = PatchFinder()
patches = pf.get_patches(args)

class PatchWidget(urwid.TreeWidget):
	unexpanded_icon = urwid.AttrMap(urwid.TreeWidget.unexpanded_icon,
		'dirmark')
	expanded_icon = urwid.AttrMap(urwid.TreeWidget.expanded_icon,
		'dirmark')

	def __init__(self, node, name, url = ""):
		self.downloaded = False
		self.name = name
		self.url = url
		self.__super.__init__(node)
		# insert an extra AttrWrap for our own use
		self._w = urwid.AttrWrap(self._w, None)
		self.flagged = False
Esempio n. 2
0
#!/usr/bin/env python
import sys
from patchfinder import PatchFinder

from optparse import OptionParser
parser = OptionParser(usage=("%%prog [options] [command]\n"
                                 "Commands: start, stop, restart and nodaemon.\n"
                                 ))
parser.add_option("-D", "--debug",
                      action="store_true", dest="debug", default=False,
                      help="render debug to buffer and print messages")

parser.add_option("-A", "--monitor-all",
                      action="store_true", dest="all", default=False,
                      help="Add all enabled devices to be monitored.")

parser.add_option("-d", "--device",
                      action="append",
                      dest="devices", default=[],
                      help="Add device to monitor  using id.")

(options, args) = parser.parse_args()
 
pf = PatchFinder(options)
pf.run()
Esempio n. 3
0
#!/usr/bin/env python
import sys
from patchfinder import PatchFinder

if __name__ == "__main__": 
    from optparse import OptionParser
    parser = OptionParser(usage=("%%prog [options]\n"
                                 "Run with no params to watch all enabled devices.\n"
                                 ))
    parser.add_option("-D", "--debug",
                      action="store_true", dest="debug", default=False,
                      help="render debug to buffer and print messages")

    parser.add_option("-A", "--monitor-all",
                      action="store_true", dest="all", default=False,
                      help="Add all enabled devices to be monitored.")

    parser.add_option("-d", "--device",
                      action="append",
                      dest="devices", default=[],
                      help="Add device to monitor  using id.")

    (options, args) = parser.parse_args()
    
    monitor = PatchFinder(options)
    monitor.run()