fedmsg_meta_debian-0.2/0000755000175000017500000000000012266711206016545 5ustar nicolasdnicolasd00000000000000fedmsg_meta_debian-0.2/fedmsg_meta_debian/0000755000175000017500000000000012266711206022322 5ustar nicolasdnicolasd00000000000000fedmsg_meta_debian-0.2/fedmsg_meta_debian/__init__.py0000644000175000017500000000000112266705775024440 0ustar nicolasdnicolasd00000000000000 fedmsg_meta_debian-0.2/fedmsg_meta_debian/debexpo.py0000644000175000017500000000520012266705775024335 0ustar nicolasdnicolasd00000000000000# Copyright (C) 2013 Simon Chopin # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from __future__ import unicode_literals from fedmsg.meta.base import BaseProcessor import re class DebexpoProcessor(BaseProcessor): __name__ = "debexpo" __description__ = "What happens when one doesn't have upload rights just yet" __link__ = "http://mentors.debian.net" __docs__ = "Would be nice." __obj__ = "Mentoring" event2title = { 'upload': "Package upload (mentors)", 'remove': "Package removal (mentors)", 'comment': "Comment on a package (mentors)", } def title(self, msg, **config): event = msg['topic'].split('.')[-1] return self.event2title.get(event, event) def subtitle(self, msg, **config): event = msg['topic'].split('.')[-1] content = msg['msg'] if event == 'upload': return '{name} uploaded {source}_{version} on mentors'.format( name=content['uploader'], source=content['source'], version=content['version'] ) if event == 'comment': return '{name} commented on {package} on mentors.'.format( name=content['author_name'], package=content['source'] ) if event == 'remove': return '{source}_{version} has been removed from mentors ({reason})'.format(**content) return '' def link(self, msg, **config): try: source = msg['msg']['source'] except KeyError: return '' return 'http://mentors.debian.net/{}'.format(source) fedmsg_meta_debian-0.2/fedmsg_meta_debian/debmessenger.py0000644000175000017500000000765212266705775025367 0ustar nicolasdnicolasd00000000000000# Copyright (C) 2013 Simon Chopin # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from __future__ import unicode_literals from fedmsg.meta.base import BaseProcessor from fedmsg_meta_debian.utils import format_from class DebChangesProcessor(BaseProcessor): __name__ = "debmessenger.package.upload" __description__ = "Debian uploaded packages" __link__ = "http://ftpmaster.debian.org" __docs__ = "http://ftpmaster.debian.org" __obj__ = "Uploads" def title(self, msg, **config): return "Package upload" def subtitle(self, msg, **config): urgency = '' if msg['msg']['Urgency'] != 'medium': urgency = ' with urgency %s' % msg['msg']['Urgency'] return '{name} uploaded {source} ({version}) to {distribution}{urgency}'.format( name=format_from(msg['msg']['Changed-By']), source=msg['msg']['Source'], distribution=msg['msg']['Distribution'], version=msg['msg']['Version'], urgency=urgency, ) def link(self, msg, **config): return 'http://packages.qa.debian.org/{}'.format(msg['msg']['Source']) def packages(self, msg, **config): return set([msg['msg']['Source']]) class DebBugProcessor(BaseProcessor): __name__ = "debmessenger.bug" __description__ = "Debian BTS reports" __link__ = "http://bugs.debian.org" __docs__ = "http://bugs.debian.org" __obj__ = "Bugs" event2title = { 'report': "New bug report", 'closed': "Bug closed", 'followup': "Bug followup", 'transcript': "BTS transcript received", } event2subtitle = { 'report': "{person} filed {bugno}{severity} on {package}{version}: {subject}", 'closed': "{person} closed {bugno} on {package}: {subject}", 'followup': "{person} followed up to {bugno} on {package}: {subject}", 'transcript': "{person} closed {bugno} via the control bot", } def title(self, msg, **config): event = msg['topic'].split('.')[-1] return self.event2title.get(event, event) def subtitle(self, msg, **config): event = msg['topic'].split('.')[-1] data = { 'person': format_from(msg['msg']['from']), 'subject': msg['msg']['title'], 'bugno': '#%s' % msg['msg']['nb'] if msg['msg']['nb'] else 'a bug', 'severity': '', 'package': msg['msg']['package'] or msg['msg']['source'] or '', 'version': '/%s' % msg['msg']['version'] if msg['msg']['version'] else '', } if msg['msg']['severity'] and msg['msg']['severity'] != 'normal': data['severity'] = " (%s)" % msg['msg']['severity'] return self.event2subtitle[event].format(**data) def link(self, msg, **config): return 'http://bugs.debian.org/{}'.format(msg['msg']['nb']) def packages(self, msg, **config): return set([msg['msg']['source']]) fedmsg_meta_debian-0.2/fedmsg_meta_debian/utils.py0000644000175000017500000000317612266705775024061 0ustar nicolasdnicolasd00000000000000# Copyright (C) 2013 Simon Chopin # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import re mail_regexp = re.compile('(?P.*) <(?P.*)>') login_regexp = re.compile('(?P.*)@debian\.org$') def email2login(email): match = login_regexp.match(email) if match: return match.groupdict()['login'] return None def format_from(from_field): match = mail_regexp.match(from_field) if match: name, login = match.groupdict()['name'], email2login(match.groupdict()['email']) if login: return u'{name} ({login})'.format(name=name, login=login) return from_field fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/0000755000175000017500000000000012266711206024014 5ustar nicolasdnicolasd00000000000000fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/PKG-INFO0000644000175000017500000000063312266711205025112 0ustar nicolasdnicolasd00000000000000Metadata-Version: 1.0 Name: fedmsg-meta-debian Version: 0.2 Summary: fedmsg metadata providers for Debian deployment Home-page: http://anonscm.debian.org/gitweb/?p=users/laarmen-guest/fedmsg_meta_debian.git Author: Simon Chopin Author-email: chopin.simon@gmail.com License: Expat Description: This package provide metadata suited for the deployement of Fedmsg within the Debian infrastructure Platform: UNKNOWN fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/SOURCES.txt0000644000175000017500000000065312266711206025704 0ustar nicolasdnicolasd00000000000000setup.py fedmsg_meta_debian/__init__.py fedmsg_meta_debian/debexpo.py fedmsg_meta_debian/debmessenger.py fedmsg_meta_debian/utils.py fedmsg_meta_debian.egg-info/PKG-INFO fedmsg_meta_debian.egg-info/SOURCES.txt fedmsg_meta_debian.egg-info/dependency_links.txt fedmsg_meta_debian.egg-info/entry_points.txt fedmsg_meta_debian.egg-info/not-zip-safe fedmsg_meta_debian.egg-info/requires.txt fedmsg_meta_debian.egg-info/top_level.txtfedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/dependency_links.txt0000644000175000017500000000000112266711205030061 0ustar nicolasdnicolasd00000000000000 fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/entry_points.txt0000644000175000017500000000030012266711205027302 0ustar nicolasdnicolasd00000000000000[fedmsg.meta] debexpo = fedmsg_meta_debian.debexpo:DebexpoProcessor debbugs = fedmsg_meta_debian.debmessenger:DebBugProcessor debchanges = fedmsg_meta_debian.debmessenger:DebChangesProcessor fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/not-zip-safe0000644000175000017500000000000112266705776026261 0ustar nicolasdnicolasd00000000000000 fedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/requires.txt0000644000175000017500000000000612266711205026407 0ustar nicolasdnicolasd00000000000000fedmsgfedmsg_meta_debian-0.2/fedmsg_meta_debian.egg-info/top_level.txt0000644000175000017500000000002312266711205026540 0ustar nicolasdnicolasd00000000000000fedmsg_meta_debian fedmsg_meta_debian-0.2/setup.py0000644000175000017500000000376612266711134020273 0ustar nicolasdnicolasd00000000000000# Copyright (C) Simon Chopin # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from setuptools import setup install_requires = [ 'fedmsg', ] setup( name='fedmsg_meta_debian', version='0.2', description='fedmsg metadata providers for Debian deployment', long_description= '''This package provide metadata suited for the deployement of Fedmsg within the Debian infrastructure''', author='Simon Chopin', author_email='chopin.simon@gmail.com', url='http://anonscm.debian.org/gitweb/?p=users/laarmen-guest/fedmsg_meta_debian.git', license='Expat', install_requires=install_requires, packages=[ 'fedmsg_meta_debian', ], include_package_data=True, zip_safe=False, entry_points={ 'fedmsg.meta': [ "debchanges=fedmsg_meta_debian.debmessenger:DebChangesProcessor", "debbugs=fedmsg_meta_debian.debmessenger:DebBugProcessor", "debexpo=fedmsg_meta_debian.debexpo:DebexpoProcessor", ] } ) fedmsg_meta_debian-0.2/PKG-INFO0000644000175000017500000000063312266711206017644 0ustar nicolasdnicolasd00000000000000Metadata-Version: 1.0 Name: fedmsg_meta_debian Version: 0.2 Summary: fedmsg metadata providers for Debian deployment Home-page: http://anonscm.debian.org/gitweb/?p=users/laarmen-guest/fedmsg_meta_debian.git Author: Simon Chopin Author-email: chopin.simon@gmail.com License: Expat Description: This package provide metadata suited for the deployement of Fedmsg within the Debian infrastructure Platform: UNKNOWN fedmsg_meta_debian-0.2/setup.cfg0000644000175000017500000000007312266711206020366 0ustar nicolasdnicolasd00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0