--- phenny-2~hg28.orig/debian/README.source +++ phenny-2~hg28/debian/README.source @@ -0,0 +1,20 @@ +Source README +============= + +The upstream source can be downloaded with the following command: + + ./debian/rules get-orig-source + +You will need the following packages installed: + + mercurial + +You can patch the upstream source with the following command: + + ./debian/rules patch + +You can add or edit patches using the following command: + + cdbs-edit-patch + + -- Noah Slater , Wed, 14 Jan 2009 16:45:47 +0000 --- phenny-2~hg28.orig/debian/changelog +++ phenny-2~hg28/debian/changelog @@ -0,0 +1,76 @@ +phenny (2~hg28-3) unstable; urgency=medium + + [ Jakub Wilk ] + * Use canonical URIs for Vcs-* fields. + + [ Andrey Rahmatullin ] + * Port from python-support to dh-python (Closes: #786107) + * Drop obsolete debian/{pycompat,pyversions} + + -- Python Applications Packaging Team Sun, 30 Aug 2015 13:05:56 +0500 + +phenny (2~hg28-2) unstable; urgency=low + + * Team upload. + * Drop 05_python-version.dpatch, set minimum required version via + XS-Python-Version and use unversioned interpreter in shebang + Closes: #596311 + + -- Piotr Ożarowski Sun, 12 Sep 2010 16:41:19 +0200 + +phenny (2~hg28-1) unstable; urgency=low + + [ Noah Slater ] + * New upstream version, security fix and oblique command added. + * Added debian/README.source file. + * Updated debian/control, removed Build-Depends on cdbs. + * Updated debian/control, updated Build-Depends on debhelper to 7.2.11. + * Updated debian/control, changed Standards-Version to 3.8.1. + * Updated debian/control, changed Vcs-Browser. + * Updated debian/copyright, changed for latest proposed format. + * Updated debian/patches, converted all patches to dpatch system. + * Updated debian/patches/module-home.patch, relative home. Closes: #516038 + * Updated debian/rules to use full debhelper system. + * Deleted debian/patches/bot-announce.patch, announce functionality. + + [ Sandro Tosi ] + * debian/control + - switch Uploaders and Maintainer fields (package is team maintained) + - bump Standards-Version to 3.8.3 (no changes needed) + + -- Python Applications Packaging Team Thu, 15 Oct 2009 20:56:23 +0200 + +phenny (2~hg16-1) unstable; urgency=low + + * New upstream version, updated translation module. + + -- Noah Slater Sat, 24 May 2008 18:21:36 +0100 + +phenny (2~hg15-1) unstable; urgency=low + + * New upstream version, updated translation module. + + -- Noah Slater Tue, 20 May 2008 18:42:25 +0100 + +phenny (2~hg14-1) unstable; urgency=low + + * New upstream version. + * Updated debian/patches/command-option.patch, correct import. Closes: #478033 + * Updated debian/copyright, changed for latest proposed format. + + -- Noah Slater Mon, 28 Apr 2008 17:49:58 +0100 + +phenny (2~hg11-2) unstable; urgency=medium + + * Added debian/patches/bot-announce.patch, announce functionality. + * Updated debian/rules, general standards improvement. + * Updated debian/control, corrected Depends and Build-Depends-Indep on + versioned python. Closes: #471617 + + -- Noah Slater Sun, 30 Mar 2008 21:59:02 +0100 + +phenny (2~hg11-1) unstable; urgency=low + + * Initial release. Closes: #458095 + + -- Noah Slater Sun, 09 Mar 2008 14:42:05 +0100 --- phenny-2~hg28.orig/debian/compat +++ phenny-2~hg28/debian/compat @@ -0,0 +1 @@ +5 --- phenny-2~hg28.orig/debian/control +++ phenny-2~hg28/debian/control @@ -0,0 +1,20 @@ +Source: phenny +Section: python +Priority: optional +Maintainer: Python Applications Packaging Team +Uploaders: Noah Slater +Standards-Version: 3.8.3 +Build-Depends: debhelper (>= 7.2.11), dpatch +Build-Depends-Indep: help2man, dh-python, python +Homepage: http://inamidst.com/phenny/ +Vcs-Svn: svn://anonscm.debian.org/python-apps/packages/phenny/trunk/ +Vcs-Browser: http://anonscm.debian.org/viewvc/python-apps/packages/phenny/trunk/ +XS-Python-Version: >= 2.5 + +Package: phenny +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Description: extensible IRC bot written in Python + Phenny is a lightweight IRC bot with the usual facilities that one expects such + as a Wordnet interface and thesaurus lookups. Modularly extensible with Python + and can reload modules on the fly. --- phenny-2~hg28.orig/debian/copyright +++ phenny-2~hg28/debian/copyright @@ -0,0 +1,37 @@ +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=180 +Upstream-Name: Phenny +Upstream-Maintainer: Sean B. Palmer +Upstream-Source: http://inamidst.com/phenny/ + +Files: * +Copyright: Copyright 2008, Sean B. Palmer +License: EFL-2 + Eiffel Forum License, version 2 + . + 1. Permission is hereby granted to use, copy, modify and/or + distribute this package, provided that: + * copyright notices are retained unchanged, + * any distribution of this package, whether modified or not, + includes this license text. + 2. Permission is hereby also granted to distribute binary programs + which depend on this package. If the binary program depends on a + modified version of this package, you are encouraged to publicly + release the modified version of this package. + . + *********************** + . + THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE. + . + *********************** + +Files: debian/* +Copyright: Copyright 2009, Noah Slater +License: GAP + Copying and distribution of this package, with or without modification, are + permitted in any medium without royalty provided the copyright notice and this + notice are preserved. --- phenny-2~hg28.orig/debian/dirs +++ phenny-2~hg28/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/lib/python2.7/dist-packages/phenny/modules --- phenny-2~hg28.orig/debian/manpages +++ phenny-2~hg28/debian/manpages @@ -0,0 +1 @@ +debian/phenny.1 --- phenny-2~hg28.orig/debian/patches/00list +++ phenny-2~hg28/debian/patches/00list @@ -0,0 +1,7 @@ +01_non-executable +02_expand-home +03_module-home +04_module-import +06_catch-exception +07_command-option +08_default-configuration --- phenny-2~hg28.orig/debian/patches/01_non-executable.dpatch +++ phenny-2~hg28/debian/patches/01_non-executable.dpatch @@ -0,0 +1,199 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_non-executable.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Remove executable lines from all modules. + +@DPATCH@ +diff -urNad phenny-2~hg28~/__init__.py phenny-2~hg28/__init__.py +--- phenny-2~hg28~/__init__.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/__init__.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + __init__.py - Phenny Init Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/bot.py phenny-2~hg28/bot.py +--- phenny-2~hg28~/bot.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/bot.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + bot.py - Phenny IRC Bot + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/icao.py phenny-2~hg28/icao.py +--- phenny-2~hg28~/icao.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/icao.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + icao.py - Phenny ICAO Codes Data + This data and module are in the public domain. +diff -urNad phenny-2~hg28~/irc.py phenny-2~hg28/irc.py +--- phenny-2~hg28~/irc.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/irc.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + irc.py - A Utility IRC Bot + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/admin.py phenny-2~hg28/modules/admin.py +--- phenny-2~hg28~/modules/admin.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/admin.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + admin.py - Phenny Admin Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/calc.py phenny-2~hg28/modules/calc.py +--- phenny-2~hg28~/modules/calc.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/calc.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # coding=utf-8 + """ + calc.py - Phenny Calculator Module +diff -urNad phenny-2~hg28~/modules/clock.py phenny-2~hg28/modules/clock.py +--- phenny-2~hg28~/modules/clock.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/clock.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + clock.py - Phenny Clock Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/codepoints.py phenny-2~hg28/modules/codepoints.py +--- phenny-2~hg28~/modules/codepoints.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/codepoints.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + codepoints.py - Phenny Codepoints Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/dict.py phenny-2~hg28/modules/dict.py +--- phenny-2~hg28~/modules/dict.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/dict.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + dict.py - Phenny Dictionary Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/etymology.py phenny-2~hg28/modules/etymology.py +--- phenny-2~hg28~/modules/etymology.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/etymology.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + etymology.py - Phenny Etymology Module + Copyright 2007, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/head.py phenny-2~hg28/modules/head.py +--- phenny-2~hg28~/modules/head.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/head.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + head.py - Phenny HTTP Metadata Utilities + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/info.py phenny-2~hg28/modules/info.py +--- phenny-2~hg28~/modules/info.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/info.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + info.py - Phenny Information Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/oblique.py phenny-2~hg28/modules/oblique.py +--- phenny-2~hg28~/modules/oblique.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/oblique.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + oblique.py - Web Services Interface + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/ping.py phenny-2~hg28/modules/ping.py +--- phenny-2~hg28~/modules/ping.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/ping.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + ping.py - Phenny Ping Module + Author: Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/reload.py phenny-2~hg28/modules/reload.py +--- phenny-2~hg28~/modules/reload.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/reload.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + reload.py - Phenny Module Reloader Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/search.py phenny-2~hg28/modules/search.py +--- phenny-2~hg28~/modules/search.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/search.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + search.py - Phenny Web Search Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/seen.py phenny-2~hg28/modules/seen.py +--- phenny-2~hg28~/modules/seen.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/seen.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + seen.py - Phenny Seen Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/startup.py phenny-2~hg28/modules/startup.py +--- phenny-2~hg28~/modules/startup.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/startup.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + startup.py - Phenny Startup Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/tell.py phenny-2~hg28/modules/tell.py +--- phenny-2~hg28~/modules/tell.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/tell.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + tell.py - Phenny Tell and Ask Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/translate.py phenny-2~hg28/modules/translate.py +--- phenny-2~hg28~/modules/translate.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/translate.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # coding=utf-8 + """ + translate.py - Phenny Translation Module +diff -urNad phenny-2~hg28~/modules/validate.py phenny-2~hg28/modules/validate.py +--- phenny-2~hg28~/modules/validate.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/validate.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + validate.py - Phenny Validation Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/weather.py phenny-2~hg28/modules/weather.py +--- phenny-2~hg28~/modules/weather.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/weather.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + weather.py - Phenny Weather Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/wikipedia.py phenny-2~hg28/modules/wikipedia.py +--- phenny-2~hg28~/modules/wikipedia.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/wikipedia.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + wikipedia.py - Phenny Wikipedia Module + Copyright 2008, Sean B. Palmer, inamidst.com +diff -urNad phenny-2~hg28~/modules/wiktionary.py phenny-2~hg28/modules/wiktionary.py +--- phenny-2~hg28~/modules/wiktionary.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/wiktionary.py 2009-05-04 18:27:50.000000000 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """ + wiktionary.py - Phenny Wiktionary Module + Copyright 2009, Sean B. Palmer, inamidst.com --- phenny-2~hg28.orig/debian/patches/02_expand-home.dpatch +++ phenny-2~hg28/debian/patches/02_expand-home.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_expand-home.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Expand the user home directory in the configuration file. + +@DPATCH@ +diff -urNad phenny-2~hg28~/bot.py phenny-2~hg28/bot.py +--- phenny-2~hg28~/bot.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/bot.py 2009-05-04 18:21:57.000000000 +0100 +@@ -8,6 +8,7 @@ + """ + + import sys, os, re, threading, imp ++from os import path + import irc + + home = os.getcwd() +@@ -43,6 +44,7 @@ + + if hasattr(self.config, 'extra'): + for fn in self.config.extra: ++ fn = path.expanduser(fn) + if os.path.isfile(fn): + filenames.append(fn) + elif os.path.isdir(fn): --- phenny-2~hg28.orig/debian/patches/03_module-home.dpatch +++ phenny-2~hg28/debian/patches/03_module-home.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_module-home.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Load modules from a relative package directory. + +@DPATCH@ +diff -urNad phenny-2~hg28~/bot.py phenny-2~hg28/bot.py +--- phenny-2~hg28~/bot.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/bot.py 2009-05-04 18:22:33.000000000 +0100 +@@ -10,7 +10,7 @@ + import sys, os, re, threading, imp + import irc + +-home = os.getcwd() ++home = path.dirname(__file__) + + def decode(bytes): + try: text = bytes.decode('utf-8') --- phenny-2~hg28.orig/debian/patches/04_module-import.dpatch +++ phenny-2~hg28/debian/patches/04_module-import.dpatch @@ -0,0 +1,207 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04_module-import.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Load modules from the correct package. + +@DPATCH@ +diff -urNad phenny-2~hg28~/modules/calc.py phenny-2~hg28/modules/calc.py +--- phenny-2~hg28~/modules/calc.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/calc.py 2009-05-04 18:23:29.000000000 +0100 +@@ -9,7 +9,7 @@ + """ + + import re +-import web ++from phenny import web + + r_result = re.compile(r'(?i)(.*?)') + r_tag = re.compile(r'<\S+.*?>') +diff -urNad phenny-2~hg28~/modules/clock.py phenny-2~hg28/modules/clock.py +--- phenny-2~hg28~/modules/clock.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/clock.py 2009-05-04 18:23:41.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import math, time, urllib +-from tools import deprecated ++from phenny.tools import deprecated + + TimeZones = {'KST': 9, 'CADT': 10.5, 'EETDST': 3, 'MESZ': 2, 'WADT': 9, + 'EET': 2, 'MST': -7, 'WAST': 8, 'IST': 5.5, 'B': 2, +diff -urNad phenny-2~hg28~/modules/dict.py phenny-2~hg28/modules/dict.py +--- phenny-2~hg28~/modules/dict.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/dict.py 2009-05-04 18:24:06.000000000 +0100 +@@ -8,8 +8,8 @@ + """ + + import re, urllib +-import web +-from tools import deprecated ++from phenny import web ++from phenny.tools import deprecated + + formuri = 'http://wordnet.princeton.edu/perl/webwn?s=' + +diff -urNad phenny-2~hg28~/modules/etymology.py phenny-2~hg28/modules/etymology.py +--- phenny-2~hg28~/modules/etymology.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/etymology.py 2009-05-04 18:24:15.000000000 +0100 +@@ -8,8 +8,8 @@ + """ + + import re +-import web +-from tools import deprecated ++from phenny import web ++from phenny.tools import deprecated + + etyuri = 'http://etymonline.com/?term=%s' + etysearch = 'http://etymonline.com/?search=%s' +diff -urNad phenny-2~hg28~/modules/head.py phenny-2~hg28/modules/head.py +--- phenny-2~hg28~/modules/head.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/head.py 2009-05-04 18:24:25.000000000 +0100 +@@ -9,8 +9,8 @@ + + import re, urllib, urllib2, httplib, urlparse, time + from htmlentitydefs import name2codepoint +-import web +-from tools import deprecated ++from phenny import web ++from phenny.tools import deprecated + + def head(phenny, input): + """Provide HTTP HEAD information.""" +diff -urNad phenny-2~hg28~/modules/oblique.py phenny-2~hg28/modules/oblique.py +--- phenny-2~hg28~/modules/oblique.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/oblique.py 2009-05-04 18:24:38.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import re, urllib +-import web ++from phenny import web + + definitions = 'http://code.google.com/p/phenny-ws/wiki/ServiceDefinitions' + +diff -urNad phenny-2~hg28~/modules/reload.py phenny-2~hg28/modules/reload.py +--- phenny-2~hg28~/modules/reload.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/reload.py 2009-05-04 18:25:32.000000000 +0100 +@@ -7,7 +7,7 @@ + http://inamidst.com/phenny/ + """ + +-import irc ++from phenny import irc + + def f_reload(phenny, input): + """Reloads a module, for use by admins only.""" +@@ -21,9 +21,9 @@ + phenny.setup() + return phenny.reply('done') + +- try: module = getattr(__import__('modules.' + name), name) ++ try: module = __import__('phenny.modules.' + name, "", "", [""]) + except ImportError: +- module = getattr(__import__('opt.' + name), name) ++ module = __import__('phenny.opt.' + name, "", "", [""]) + reload(module) + + if hasattr(module, '__file__'): +diff -urNad phenny-2~hg28~/modules/search.py phenny-2~hg28/modules/search.py +--- phenny-2~hg28~/modules/search.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/search.py 2009-05-04 18:25:57.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import re +-import web ++from phenny import web + + r_string = re.compile(r'("(\\.|[^"\\])*")') + r_json = re.compile(r'^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]+$') +diff -urNad phenny-2~hg28~/modules/seen.py phenny-2~hg28/modules/seen.py +--- phenny-2~hg28~/modules/seen.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/seen.py 2009-05-04 18:26:08.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import time +-from tools import deprecated ++from phenny.tools import deprecated + + @deprecated + def f_seen(self, origin, match, args): +diff -urNad phenny-2~hg28~/modules/tell.py phenny-2~hg28/modules/tell.py +--- phenny-2~hg28~/modules/tell.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/tell.py 2009-05-04 18:26:23.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import os, re, time, random +-import web ++from phenny import web + + maximum = 4 + lispchannels = frozenset([ '#lisp', '#scheme', '#opendarwin', '#macdev', +diff -urNad phenny-2~hg28~/modules/translate.py phenny-2~hg28/modules/translate.py +--- phenny-2~hg28~/modules/translate.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/translate.py 2009-05-04 18:26:28.000000000 +0100 +@@ -9,7 +9,7 @@ + """ + + import re, urllib +-import web ++from phenny import web + + r_json = re.compile(r'^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]+$') + r_string = re.compile(r'("(\\.|[^"\\])*")') +diff -urNad phenny-2~hg28~/modules/validate.py phenny-2~hg28/modules/validate.py +--- phenny-2~hg28~/modules/validate.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/validate.py 2009-05-04 18:26:33.000000000 +0100 +@@ -7,7 +7,7 @@ + http://inamidst.com/phenny/ + """ + +-import web ++from phenny import web + + def val(phenny, input): + """Check a webpage using the W3C Markup Validator.""" +diff -urNad phenny-2~hg28~/modules/weather.py phenny-2~hg28/modules/weather.py +--- phenny-2~hg28~/modules/weather.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/weather.py 2009-05-04 18:26:42.000000000 +0100 +@@ -8,8 +8,8 @@ + """ + + import re, urllib +-import web +-from tools import deprecated ++from phenny import web ++from phenny.tools import deprecated + + r_from = re.compile(r'(?i)([+-]\d+):00 from') + +diff -urNad phenny-2~hg28~/modules/wikipedia.py phenny-2~hg28/modules/wikipedia.py +--- phenny-2~hg28~/modules/wikipedia.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/wikipedia.py 2009-05-04 18:26:50.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import re, urllib +-import web ++from phenny import web + + wikiuri = 'http://en.wikipedia.org/wiki/%s' + wikisearch = 'http://en.wikipedia.org/wiki/Special:Search?' \ +diff -urNad phenny-2~hg28~/modules/wiktionary.py phenny-2~hg28/modules/wiktionary.py +--- phenny-2~hg28~/modules/wiktionary.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/modules/wiktionary.py 2009-05-04 18:27:36.000000000 +0100 +@@ -8,7 +8,7 @@ + """ + + import re +-import web ++from phenny import web + + uri = 'http://en.wiktionary.org/w/index.php?title=%s&printable=yes' + r_tag = re.compile(r'<[^>]+>') --- phenny-2~hg28.orig/debian/patches/06_catch-exception.dpatch +++ phenny-2~hg28/debian/patches/06_catch-exception.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 06_catch-exception.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Log errors to STDOUT instead of IRC. + +@DPATCH@ +diff -urNad phenny-2~hg28~/irc.py phenny-2~hg28/irc.py +--- phenny-2~hg28~/irc.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/irc.py 2009-05-04 18:30:56.000000000 +0100 +@@ -157,20 +157,9 @@ + def error(self, origin): + try: + import traceback +- trace = traceback.format_exc() +- print trace +- lines = list(reversed(trace.splitlines())) +- +- report = [lines[0].strip()] +- for line in lines: +- line = line.strip() +- if line.startswith('File "/'): +- report.append(line[0].lower() + line[1:]) +- break +- else: report.append('source unknown') +- +- self.msg(origin.sender, report[0] + ' (' + report[1] + ')') +- except: self.msg(origin.sender, "Got an error.") ++ print >> sys.stderr, traceback.format_exc() ++ except: ++ print >> sys.stderr, "Unknown error." + + class TestBot(Bot): + def f_ping(self, origin, match, args): --- phenny-2~hg28.orig/debian/patches/07_command-option.dpatch +++ phenny-2~hg28/debian/patches/07_command-option.dpatch @@ -0,0 +1,183 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07_command-option.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Improve the command option handling. + +@DPATCH@ +diff -urNad phenny-2~hg28~/__init__.py phenny-2~hg28/__init__.py +--- phenny-2~hg28~/__init__.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/__init__.py 2009-05-04 18:35:26.000000000 +0100 +@@ -27,13 +27,13 @@ + try: os.kill(self.child, signal.SIGKILL) + except OSError: pass + +-def run_phenny(config): ++def run_phenny(config, verbose): + if hasattr(config, 'delay'): + delay = config.delay + else: delay = 20 + + def connect(config): +- p = bot.Phenny(config) ++ p = bot.Phenny(config, verbose) + p.run(config.host, config.port) + + try: Watcher() +@@ -52,8 +52,8 @@ + print >> sys.stderr, warning + time.sleep(delay) + +-def run(config): +- t = threading.Thread(target=run_phenny, args=(config,)) ++def run(config, verbose): ++ t = threading.Thread(target=run_phenny, args=(config,verbose)) + if hasattr(t, 'run'): + t.run() + else: t.start() +diff -urNad phenny-2~hg28~/bot.py phenny-2~hg28/bot.py +--- phenny-2~hg28~/bot.py 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/bot.py 2009-05-04 18:34:47.000000000 +0100 +@@ -21,9 +21,10 @@ + return text + + class Phenny(irc.Bot): +- def __init__(self, config): ++ def __init__(self, config, verbose): + irc.Bot.__init__(self, config.nick, config.name, config.channels) + self.config = config ++ self.verbose = verbose + self.doc = {} + self.stats = {} + self.setup() +@@ -62,12 +63,16 @@ + self.register(vars(module)) + modules.append(name) + +- if modules: +- print >> sys.stderr, 'Registered modules:', ', '.join(modules) ++ if modules: ++ if self.verbose: ++ print >> sys.stderr, 'Registered modules:', ', '.join(modules) + else: print >> sys.stderr, "Warning: Couldn't find any modules" + + self.bind_commands() + ++ if self.verbose: ++ print "Phenny has loaded config: %s" % self.config.__file__ ++ + def register(self, variables): + # This is used by reload.py, hence it being methodised + for name, obj in variables.iteritems(): +@@ -78,7 +83,8 @@ + self.commands = {'high': {}, 'medium': {}, 'low': {}} + + def bind(self, priority, regexp, func): +- print priority, regexp.pattern.encode('utf-8'), func ++ if self.verbose: ++ print priority, regexp.pattern.encode('utf-8'), func + # register documentation + if not hasattr(func, 'name'): + func.name = func.__name__ +diff -urNad phenny-2~hg28~/phenny phenny-2~hg28/phenny +--- phenny-2~hg28~/phenny 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/phenny 2009-05-04 18:37:59.000000000 +0100 +@@ -12,6 +12,7 @@ + """ + + import sys, os, imp, optparse ++from os import path + from textwrap import dedent as trim + + dotdir = os.path.expanduser('~/.phenny') +@@ -101,20 +102,74 @@ + # Step One: Check Dependencies + + check_python_version() # require python2.4 or later +- check_dotdir() # require ~/.phenny, or make it and exit + + # Step Two: Parse The Command Line + +- parser = optparse.OptionParser('%prog [options]') +- parser.add_option('-c', '--config', metavar='fn', +- help='use this configuration file or directory') +- opts, args = parser.parse_args(argv) +- if args: print >> sys.stderr, 'Warning: ignoring spurious arguments' ++ def display_error(message): ++ print >> sys.stderr, message ++ print >> sys.stderr ++ print >> sys.stderr, "Try `phenny -h' for more information." ++ sys.exit(1) ++ ++ verbose = False ++ config = None ++ for key, arg in enumerate(sys.argv[1:]): ++ if arg == "-h" or arg == "--help": ++ print """Usage: phenny [OPTION]... ++ ++Options: ++ ++ -h, --help display a short help message and exit ++ -V, --version display version information and exit ++ -v, --verbose display extended startup information ++ -c, --config CONFIG use CONFIG as the configuration file or directory ++ ++Examples: ++ ++To start using Phenny run the phenny command: ++ ++ phenny ++ ++Edit the default files created in your home directory: ++ ++ sensible-editor ~/.phenny/default.py ++ ++You can now start Phenny and try out your configuration: ++ ++ phenny ++ ++If you want to start Phenny as a background process you might run: ++ ++ nohup phenny 2> ~/.phenny/log.txt & ++ ++Report bugs using the `reportbug phenny' command.""" ++ sys.exit(0) ++ elif arg == "-V" or arg == "--version": ++ print """phenny - Phenny ++ ++Copyright 2008, Sean B. Palmer ++ ++Licensed under the Eiffel Forum License 2. ++ ++Written by Sean B. Palmer .""" ++ sys.exit(0) ++ elif arg == "-v" or arg == "--verbose": ++ verbose = True ++ elif arg == "-c" or arg == "--config": ++ config = sys.argv[key + 2] ++ if not path.exists(config): ++ display_error("The file or directory does not exist: %s" % config) ++ elif arg.startswith("-"): ++ display_error("Unknown option: %s" % arg) ++ else: ++ display_error("Unknown argument: %s" % arg) ++ ++ check_dotdir() # require ~/.phenny, or make it and exit + + # Step Three: Load The Configurations + + config_modules = [] +- for config_name in config_names(opts.config): ++ for config_name in config_names(config): + name = os.path.basename(config_name).split('.')[0] + '_config' + module = imp.load_source(name, config_name) + module.filename = config_name +@@ -149,7 +204,7 @@ + + # @@ ignore SIGHUP + for config_module in config_modules: +- run(config_module) # @@ thread this ++ run(config_module, verbose) # @@ thread this + + if __name__ == '__main__': + main() --- phenny-2~hg28.orig/debian/patches/08_default-configuration.dpatch +++ phenny-2~hg28/debian/patches/08_default-configuration.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 08_default-configuration.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Improve the default configuration file. + +@DPATCH@ +diff -urNad phenny-2~hg28~/phenny phenny-2~hg28/phenny +--- phenny-2~hg28~/phenny 2009-04-27 19:32:51.000000000 +0100 ++++ phenny-2~hg28/phenny 2009-05-04 18:39:12.000000000 +0100 +@@ -25,28 +25,28 @@ + def create_default_config(fn): + f = open(fn, 'w') + print >> f, trim("""\ +- nick = 'phenny' +- host = 'irc.example.net' +- channels = ['#example', '#test'] +- owner = 'yournickname' ++ nick = "phenny" ++ host = "irc.example.net" ++ # password = "password" ++ channels = ["#example", "#test"] ++ owner = "your-nick" + +- # This isn't implemented yet: +- # serverpass = 'yourserverpassword' ++ # people allowed to use admin.py functions ++ admins = [owner, "other-nick"] + +- # These are people who will be able to use admin.py's functions... +- admins = [owner, 'someoneyoutrust'] +- # But admin.py is disabled by default, as follows: +- exclude = ['admin'] ++ # for available modules see /usr/share/python-support/phenny/phenny/modules + +- # If you want to enumerate a list of modules rather than disabling +- # some, use "enable = ['example']", which takes precedent over exclude +- # ++ # exclude modules ++ exclude = ["admin"] ++ ++ # enable specific modules, trumps exclude + # enable = [] + +- # Modules to load from the opt directory +- extra = [] ++ # extra modules to load by filename ++ # extra = ["~/.phenny/example-a.py", "~/.phenny/example-b.py"] + +- # EOF ++ # limit modules in specific channels ++ # limit = {"#channel": ["module-a", "module-b"]} + """) + f.close() + --- phenny-2~hg28.orig/debian/rules +++ phenny-2~hg28/debian/rules @@ -0,0 +1,37 @@ +#!/usr/bin/make -f + +# Copyright 2009, Noah Slater + +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice and this +# notice are preserved. + +include /usr/share/dpatch/dpatch.make + +clean: unpatch +build: patch-stamp + +%: + dh $@ --with python2 + +override_dh_auto_build: + +override_dh_install: + cp *.py debian/phenny/usr/lib/python2.7/dist-packages/phenny + cp modules/*.py debian/phenny/usr/lib/python2.7/dist-packages/phenny/modules + chmod -R 644 debian/phenny/usr/lib/python2.7/dist-packages/phenny/*.py + chmod -R 644 debian/phenny/usr/lib/python2.7/dist-packages/phenny/modules/*.py + cp phenny debian/phenny/usr/bin + help2man -N -n "an extensible IRC bot written in Python" ./phenny > debian/phenny.1 + +# DEB_ORIG_URI = static-http://inamidst.com/phenny/ +# DEB_ORIG_DIRECTORY=$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION) +# DEB_ORIG_FILENAME=$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz +# DEB_REPOS_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r "s/.*~hg//") + +# # @@ only works from source directory, see #494141 +# .PHONY: get-orig-source +# get-orig-source: +# hg clone -r $(DEB_REPOS_VERSION) $(DEB_ORIG_URI) $(DEB_ORIG_DIRECTORY) +# tar -czf $(DEB_ORIG_FILENAME) $(DEB_ORIG_DIRECTORY) --exclude .hg +# rm -fr $(DEB_ORIG_DIRECTORY) --- phenny-2~hg28.orig/debian/source.lintian-overrides +++ phenny-2~hg28/debian/source.lintian-overrides @@ -0,0 +1 @@ +phenny source: debian-watch-file-is-missing --- phenny-2~hg28.orig/debian/source/format +++ phenny-2~hg28/debian/source/format @@ -0,0 +1 @@ +1.0