Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 30 lines (23 sloc) 0.892 kb
#!/usr/bin/env python
"""Builds a widget using CONTENT_DIR as the source.
Outputs to WIDGET_NAME.wdgt in current working directory.
Overwrites WIDGET_NAME.wdgt if it exists"""
from optparse import OptionParser
import os
import shutil
class Widget:
def __init__(self, widgetDir, widgetName):
self.contentDir = widgetDir = widgetName
def build(self, outputDir):
outputTo = "%s/%s.wdgt" % (outputDir,
if os.path.exists(outputTo):
shutil.copytree(self.contentDir, outputTo)
if __name__ == '__main__':
parser = OptionParser(usage="Usage: %prog [h] CONTENT_DIR WIDGET_NAME" + "\n\n" + __doc__)
(options, args) = parser.parse_args()
if len(args) != 2:
parser.error('incorrect args')
wdgt = Widget(args[0], args[1])
Jump to Line
Something went wrong with that request. Please try again.