From a7466e8e0733b2d1558619b4ac65e9af5ec86c60 Mon Sep 17 00:00:00 2001 From: Chet Luther Date: Fri, 27 May 2011 10:05:15 -0500 Subject: [PATCH] ZenPack skeleton. --- MANIFEST.in | 1 + ZenPacks/__init__.py | 1 + ZenPacks/zenoss/PostgreSQL/__init__.py | 37 ++++++++++ ZenPacks/zenoss/PostgreSQL/lib/__init__.py | 1 + .../zenoss/PostgreSQL/modeler/__init__.py | 0 .../PostgreSQL/modeler/plugins/__init__.py | 0 .../zenoss/PostgreSQL/objects/objects.xml | 3 + ZenPacks/zenoss/__init__.py | 1 + setup.py | 69 +++++++++++++++++++ 9 files changed, 113 insertions(+) create mode 100644 MANIFEST.in create mode 100644 ZenPacks/__init__.py create mode 100644 ZenPacks/zenoss/PostgreSQL/__init__.py create mode 100644 ZenPacks/zenoss/PostgreSQL/lib/__init__.py create mode 100644 ZenPacks/zenoss/PostgreSQL/modeler/__init__.py create mode 100644 ZenPacks/zenoss/PostgreSQL/modeler/plugins/__init__.py create mode 100644 ZenPacks/zenoss/PostgreSQL/objects/objects.xml create mode 100644 ZenPacks/zenoss/__init__.py create mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..e91e1bf --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +graft ZenPacks diff --git a/ZenPacks/__init__.py b/ZenPacks/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/ZenPacks/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/ZenPacks/zenoss/PostgreSQL/__init__.py b/ZenPacks/zenoss/PostgreSQL/__init__.py new file mode 100644 index 0000000..5acd3ab --- /dev/null +++ b/ZenPacks/zenoss/PostgreSQL/__init__.py @@ -0,0 +1,37 @@ +########################################################################### +# +# This program is part of Zenoss Core, an open source monitoring platform. +# Copyright (C) 2011, Zenoss Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 or (at your +# option) any later version as published by the Free Software Foundation. +# +# For complete information please visit: http://www.zenoss.com/oss/ +# +########################################################################### + +import logging +log = logging.getLogger('zen.PostgreSQL') + +from Products.ZenModel.ZenPack import ZenPack as ZenPackBase + +class ZenPack(ZenPackBase): + def install(self, app): + super(ZenPack, self).install(app) + self.symlinkPlugin() + + def remove(self, app, leaveObjects=False): + if not leaveObjects: + self.removePluginSymlink() + + super(ZenPack, self).remove(app, leaveObjects=leaveObjects) + + def symlinkPlugin(self): + # TODO: Implementation. + pass + + def removePluginSymlink(self): + # TODO: Implementation. + pass + diff --git a/ZenPacks/zenoss/PostgreSQL/lib/__init__.py b/ZenPacks/zenoss/PostgreSQL/lib/__init__.py new file mode 100644 index 0000000..143f486 --- /dev/null +++ b/ZenPacks/zenoss/PostgreSQL/lib/__init__.py @@ -0,0 +1 @@ +# __init__.py diff --git a/ZenPacks/zenoss/PostgreSQL/modeler/__init__.py b/ZenPacks/zenoss/PostgreSQL/modeler/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ZenPacks/zenoss/PostgreSQL/modeler/plugins/__init__.py b/ZenPacks/zenoss/PostgreSQL/modeler/plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ZenPacks/zenoss/PostgreSQL/objects/objects.xml b/ZenPacks/zenoss/PostgreSQL/objects/objects.xml new file mode 100644 index 0000000..5908b64 --- /dev/null +++ b/ZenPacks/zenoss/PostgreSQL/objects/objects.xml @@ -0,0 +1,3 @@ + + + diff --git a/ZenPacks/zenoss/__init__.py b/ZenPacks/zenoss/__init__.py new file mode 100644 index 0000000..de40ea7 --- /dev/null +++ b/ZenPacks/zenoss/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1673819 --- /dev/null +++ b/setup.py @@ -0,0 +1,69 @@ +################################ +# These variables are overwritten by Zenoss when the ZenPack is exported +# or saved. Do not modify them directly here. +# NB: PACKAGES is deprecated +NAME = "ZenPacks.zenoss.PostgreSQL" +VERSION = "1.0.0" +AUTHOR = "Zenoss" +LICENSE = "" +NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.zenoss'] +PACKAGES = ['ZenPacks', 'ZenPacks.zenoss', 'ZenPacks.zenoss.PostgreSQL'] +INSTALL_REQUIRES = [] +COMPAT_ZENOSS_VERS = ">=3.0" +PREV_ZENPACK_NAME = "" +# STOP_REPLACEMENTS +################################ +# Zenoss will not overwrite any changes you make below here. + +from setuptools import setup, find_packages + +setup( + # This ZenPack metadata should usually be edited with the Zenoss + # ZenPack edit page. Whenever the edit page is submitted it will + # overwrite the values below (the ones it knows about) with new values. + name = NAME, + version = VERSION, + author = AUTHOR, + license = LICENSE, + + # This is the version spec which indicates what versions of Zenoss + # this ZenPack is compatible with + compatZenossVers = COMPAT_ZENOSS_VERS, + + # previousZenPackName is a facility for telling Zenoss that the name + # of this ZenPack has changed. If no ZenPack with the current name is + # installed then a zenpack of this name if installed will be upgraded. + prevZenPackName = PREV_ZENPACK_NAME, + + # Indicate to setuptools which namespace packages the zenpack + # participates in + namespace_packages = NAMESPACE_PACKAGES, + + # Tell setuptools what packages this zenpack provides. + packages = find_packages(), + + # Tell setuptools to figure out for itself which files to include + # in the binary egg when it is built. + include_package_data = True, + + # The MANIFEST.in file is the recommended way of including additional files + # in your ZenPack. package_data is another. + #package_data = {} + + # Indicate dependencies on other python modules or ZenPacks. This line + # is modified by zenoss when the ZenPack edit page is submitted. Zenoss + # tries to put add/delete the names it manages at the beginning of this + # list, so any manual additions should be added to the end. Things will + # go poorly if this line is broken into multiple lines or modified to + # dramatically. + install_requires = INSTALL_REQUIRES, + + # Every ZenPack egg must define exactly one zenoss.zenpacks entry point + # of this form. + entry_points = { + 'zenoss.zenpacks': '%s = %s' % (NAME, NAME), + }, + + # All ZenPack eggs must be installed in unzipped form. + zip_safe = False, +)