[Python-apps-commits] r4784 - in packages/ibid/trunk/debian (2 files)

stefanor-guest at users.alioth.debian.org stefanor-guest at users.alioth.debian.org
Tue Feb 16 11:32:52 UTC 2010


    Date: Tuesday, February 16, 2010 @ 11:32:50
  Author: stefanor-guest
Revision: 4784

New upstream revision, update separate-data.diff

Modified:
  packages/ibid/trunk/debian/changelog
  packages/ibid/trunk/debian/patches/separate-data.diff

Modified: packages/ibid/trunk/debian/changelog
===================================================================
--- packages/ibid/trunk/debian/changelog	2010-02-16 01:41:59 UTC (rev 4783)
+++ packages/ibid/trunk/debian/changelog	2010-02-16 11:32:50 UTC (rev 4784)
@@ -1,3 +1,11 @@
+ibid (0+bzr888+dfsg-1) UNRELEASED; urgency=low
+
+  * New upstream revision.
+  * Update separate-data patch. Upstream incorporated fixes to make this patch
+    much simpler and less invasive.
+
+ -- Stefano Rivera <stefano at rivera.za.net>  Tue, 16 Feb 2010 13:28:29 +0200
+
 ibid (0+bzr881+dfsg-1) experimental; urgency=low
 
   * Initial release (Closes: #565885)

Modified: packages/ibid/trunk/debian/patches/separate-data.diff
===================================================================
--- packages/ibid/trunk/debian/patches/separate-data.diff	2010-02-16 01:41:59 UTC (rev 4783)
+++ packages/ibid/trunk/debian/patches/separate-data.diff	2010-02-16 11:32:50 UTC (rev 4784)
@@ -1,110 +1,11 @@
-Description: As data will be stored in /usr/share/ibid, replace pkg_resources
- imports with a library that looks in /usr/share/ibid.
+Description: Data will be stored in /usr/share/ibid.
+ Don't try to install it from setup.py.
+ Update Ibid's locate_resource helper to look in /usr/share and provide
+ emulation functions for ibid-setup which doesn't use locate_resource.
 Author: Stefano Rivera <stefano at rivera.za.net>
 Forwarded: not-needed
-Last-Update: 2010-02-07
+Last-Update: 2010-02-16
 
---- /dev/null
-+++ b/ibid/debian_resources.py
-@@ -0,0 +1,40 @@
-+# Copyright (c) 2010, Stefano Rivera
-+# Released under terms of the MIT/X/Expat Licence. See COPYING for details.
-+
-+import os.path
-+import sys
-+
-+from jinja import FileSystemLoader
-+
-+class ResourceNotFoundException(Exception):
-+    def __init__(self, message):
-+        self.message = message
-+
-+    def __repr__(self):
-+        return self.message
-+
-+
-+def _resolve_package(package):
-+    fspackage = package.replace('.', '/')
-+    for dir_ in sys.path:
-+        if os.path.isfile(os.path.join(dir_, fspackage, '__init__.py')):
-+            return fspackage
-+        if os.path.isfile(os.path.join(dir_, fspackage + '.py')):
-+            return os.path.dirname(fspackage)
-+
-+    raise ResourceNotFoundException('Cannot locate package: ' + package)
-+
-+def resource_filename(package, resource):
-+    path = os.path.join('/usr/share', _resolve_package(package), resource)
-+    return os.path.normpath(path)
-+
-+def resource_exists(package, resource):
-+    return os.path.exists(resource_filename(package, resource))
-+
-+def resource_stream(package, resource):
-+    return file(resource_filename(package, resource), 'rb')
-+
-+def PackageLoader(package, path):
-+    return FileSystemLoader(resource_filename(package, path))
-+
-+# vi: set et sta sw=4 ts=4:
---- a/ibid/config.py
-+++ b/ibid/config.py
-@@ -5,7 +5,7 @@
- 
- from configobj import ConfigObj
- from validate import Validator
--from pkg_resources import resource_stream
-+from ibid.debian_resources import resource_stream
- 
- import ibid
- 
---- a/ibid/plugins/urlgrab.py
-+++ b/ibid/plugins/urlgrab.py
-@@ -8,7 +8,7 @@
- import logging
- import re
- 
--from pkg_resources import resource_exists, resource_stream
-+from ibid.debian_resources import resource_exists, resource_stream
- 
- import ibid
- from ibid.plugins import Processor, handler
---- a/ibid/source/http.py
-+++ b/ibid/source/http.py
-@@ -6,8 +6,8 @@
- from twisted.web import server, resource, static, xmlrpc, soap
- from twisted.application import internet
- from twisted.internet import reactor
--from pkg_resources import resource_filename
--from jinja import Environment, PackageLoader
-+from ibid.debian_resources import resource_filename, PackageLoader
-+from jinja import Environment
- 
- import ibid
- from ibid.source import IbidSourceFactory
---- a/scripts/ibid-setup
-+++ b/scripts/ibid-setup
-@@ -11,7 +11,7 @@
- from os.path import exists
- from shutil import copyfileobj
- 
--from pkg_resources import resource_filename, resource_stream
-+from ibid.debian_resources import resource_filename, resource_stream
- from twisted.python.modules import getModule
- 
- sys.path.insert(0, '.')
---- a/ibid/plugins/meetings.py
-+++ b/ibid/plugins/meetings.py
-@@ -11,7 +11,8 @@
- 
- from dateutil.parser import parse
- from dateutil.tz import tzlocal, tzutc
--from jinja import Environment, PackageLoader
-+from jinja import Environment
-+from ibid.debian_resources import PackageLoader
- 
- import ibid
- from ibid.compat import json
 --- a/MANIFEST.in
 +++ b/MANIFEST.in
 @@ -1,12 +1,9 @@
@@ -120,3 +21,47 @@
  include twisted/plugins/ibid_plugin.py
  include INSTALL
  include COPYING
+--- a/ibid/utils/__init__.py
++++ b/ibid/utils/__init__.py
+@@ -17,7 +17,6 @@
+ import zlib
+ 
+ from dateutil.tz import tzlocal, tzutc
+-from pkg_resources import resource_exists, resource_filename
+ 
+ import ibid
+ from ibid.compat import defaultdict, json
+@@ -236,8 +235,10 @@
+     ))
+     if os.path.exists(fspath):
+         return fspath
+-    if not resource_exists(path, filename):
++
++    debianpath = os.path.join(*(['/usr/share'] + path.split('.') + [filename]))
++    if not os.path.exists(debianpath):
+         return None
+-    return resource_filename(path, filename)
++    return debianpath
+ 
+ # vi: set et sta sw=4 ts=4:
+--- a/scripts/ibid-setup
++++ b/scripts/ibid-setup
+@@ -8,10 +8,16 @@
+ from sys import exit, stderr
+ from getpass import getpass
+ from os import getenv
+-from os.path import exists
++from os.path import exists, join
+ from shutil import copyfileobj
+ 
+-from pkg_resources import resource_filename, resource_stream
++# Debian replacements for pkg_resources
++def resource_filename(package, resource):
++    return join('/usr/share', package, resource)
++
++def resource_stream(package, resource):
++    return file(resource_filename(package, resource), 'rb')
++
+ from twisted.python.modules import getModule
+ 
+ sys.path.insert(0, '.')




More information about the Python-apps-commits mailing list