def alert(self, message, params=None, **kwargs): """Trigger a custom alert (ex: .alert <service_key> <description>.""" params = params.split(" ") service_key = params.pop(0) description = " ".join(params) data = { "service_key": service_key, "event_type": "trigger", "description": description, "details": description, "client": "pyhole %s" % version.version(), "client_url": "https://github.com/jk0/pyhole" } events_host = "https://events.pagerduty.com/" url = "%s/generic/2010-04-15/create_event.json" % events_host req = request.post(url, headers=self.api_headers, json=data) if request.ok(req): message.dispatch("Triggered.") else: message.dispatch("Unable to trigger alert: %d" % req.status_code) message.dispatch(req.text)
#source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'pyhole' copyright = u'2016, Josh Kearney' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. from pyhole.core import version as v version = v.version() # The full version, including alpha/beta/rc tags. release = v.version_hash() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files.
def test_version(self): self.assertEqual(len(version.version()), 5)
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools from pyhole.core import version setuptools.setup( name="irc-pyhole", version=version.version(), author="Josh Kearney", author_email="*****@*****.**", description="A modular IRC & Slack bot.", url="https://github.com/jk0/pyhole", zip_safe=True, classifiers=[ "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], install_requires=[ "BeautifulSoup==3.2.0", "Eventlet", "flask", "irc", "launchpadlib", "pywunderground", "requests", "slackclient", "yahoo-finance"
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools from pyhole.core import version setuptools.setup( name="irc-pyhole", version=version.version(), author="Josh Kearney", author_email="*****@*****.**", description="A modular IRC & Slack bot.", url="https://github.com/jk0/pyhole", include_package_data=True, zip_safe=True, classifiers=[ "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], install_requires=[
# The master toctree document. master_doc = "index" # General information about the project. project = u"pyhole" copyright = u"2015, Josh Kearney" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. from pyhole.core import version as v version = v.version() # The full version, including alpha/beta/rc tags. release = v.version_hash() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files.