[Checkins] SVN: zope.bugchecker/trunk/src/ Initial commit.
Charlie Clark
charlie at begeistert.org
Tue Apr 13 11:55:24 EDT 2010
Log message for revision 110809:
Initial commit.
Changed:
A zope.bugchecker/trunk/src/
A zope.bugchecker/trunk/src/setup.cfg
A zope.bugchecker/trunk/src/setup.py
A zope.bugchecker/trunk/src/zope/
A zope.bugchecker/trunk/src/zope/bugtracker/
A zope.bugchecker/trunk/src/zope/bugtracker/__init__.py
A zope.bugchecker/trunk/src/zope/bugtracker/bugtracker.py
-=-
Added: zope.bugchecker/trunk/src/setup.cfg
===================================================================
--- zope.bugchecker/trunk/src/setup.cfg (rev 0)
+++ zope.bugchecker/trunk/src/setup.cfg 2010-04-13 15:55:24 UTC (rev 110809)
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
Added: zope.bugchecker/trunk/src/setup.py
===================================================================
--- zope.bugchecker/trunk/src/setup.py (rev 0)
+++ zope.bugchecker/trunk/src/setup.py 2010-04-13 15:55:24 UTC (rev 110809)
@@ -0,0 +1,25 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1'
+
+setup(name='zope.bugtracker',
+ version=version,
+ description="Check the Zope bugtracker for new bugs",
+ long_description="""\
+""",
+ classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ keywords='',
+ author='Charlie Clark',
+ author_email='',
+ url='',
+ license='ZPL',
+ packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=['launchpadlib'
+ ],
+ entry_points="""
+ # -*- Entry points: -*-
+ """,
+ )
Property changes on: zope.bugchecker/trunk/src/setup.py
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: zope.bugchecker/trunk/src/zope/bugtracker/__init__.py
===================================================================
--- zope.bugchecker/trunk/src/zope/bugtracker/__init__.py (rev 0)
+++ zope.bugchecker/trunk/src/zope/bugtracker/__init__.py 2010-04-13 15:55:24 UTC (rev 110809)
@@ -0,0 +1 @@
+#
Property changes on: zope.bugchecker/trunk/src/zope/bugtracker/__init__.py
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: zope.bugchecker/trunk/src/zope/bugtracker/bugtracker.py
===================================================================
--- zope.bugchecker/trunk/src/zope/bugtracker/bugtracker.py (rev 0)
+++ zope.bugchecker/trunk/src/zope/bugtracker/bugtracker.py 2010-04-13 15:55:24 UTC (rev 110809)
@@ -0,0 +1,54 @@
+#!/Users/charlieclark/temp/zope/bin/python
+# encoding: utf-8
+"""
+bugtracker.py
+
+$Id$
+
+Check which bugs have been marked as 'new' for at least
+14 days
+
+Uses lauchpadlib
+https://edge.launchpad.net/+apidoc/1.0.htmls
+Particularly the projects 'collection' and project and bug_task 'entries'
+N.B. bug_tasks are not the same as bugs.
+
+Created by Charlie Clark on 2010-04-06.
+Copyright (c) 2010 Zope Foundation and Contributors
+"""
+
+import datetime
+from launchpadlib.launchpad import Launchpad
+
+today = datetime.date.today()
+two_weeks = datetime.timedelta(days=14)
+report_date = today - two_weeks
+
+class BugTracker(object):
+ """Check the BugTracker for new bugs"""
+
+ def __init__(self):
+ """Log into launchpad and get the Zope 3 project"""
+ launchpad = Launchpad.login_anonymously("Zope Bugtracker", "edge")
+ self.project = launchpad.projects['zope3']
+ self.bugs = []
+
+ def get(self):
+ """Get all new bugs and list those reported more than
+ two weeks ago.
+ Have to fumble with the reported creation date as it has a timezone
+ """
+ bugs = self.project.searchTasks(status=('New',))
+ for (idx, bug) in enumerate(bugs):
+ date_created = datetime.date(*bug.date_created.timetuple()[:3])
+ if date_created < report_date:
+ self.bugs.append("%s\n%s" % (bug.title, bug.bug_link))
+
+ def report(self):
+ """Return a printable summary"""
+ return "\n\n".join(self.bugs)
+
+if __name__ == '__main__':
+ Tracker = BugTracker()
+ Tracker.get()
+ print Tracker.report()
Property changes on: zope.bugchecker/trunk/src/zope/bugtracker/bugtracker.py
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
More information about the checkins
mailing list