Skip to content

Instantly share code, notes, and snippets.

@cluther
Created March 5, 2013 17:00
Show Gist options
  • Save cluther/5091825 to your computer and use it in GitHub Desktop.
Save cluther/5091825 to your computer and use it in GitHub Desktop.
ZenScriptBase Example
#!/usr/bin/env python
import Globals
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
class MyTool(ZenScriptBase):
def buildOptions(self):
super(MyTool, self).buildOptions()
self.parser.add_option(
'-x', dest='myoption',
help='My option.')
def run(self):
print "%s - %s" % (self.dmd, self.options.myoption)
if __name__ == '__main__':
tool = MyTool(connect=True)
tool.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment