Merge lp:~stefanor/ibid/external-modules-501728 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: not available
Merged at revision: 827
Proposed branch: lp:~stefanor/ibid/external-modules-501728
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 96 lines (+14/-1)
6 files modified
ibid/__init__.py (+1/-0)
ibid/core.py (+2/-0)
ibid/plugins/__init__.py (+3/-0)
scripts/ibid-db (+3/-1)
scripts/ibid-plugin (+3/-0)
scripts/ibid-setup (+2/-0)
To merge this branch: bzr merge lp:~stefanor/ibid/external-modules-501728
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+16737@code.launchpad.net

This proposal supersedes a proposal from 2010-01-02.

To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote : Posted in a previous version of this proposal

> +sys.path.insert(1, '.')

Ibid won't necessarily be started in the botdir -- options['base'] contains
the directory based on the location of the config file.

 review needs_fixing

review: Needs Fixing
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) wrote :

I see what it's doing, but I don't know what effects it might have overall.

One way to find out...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ibid/__init__.py'
--- ibid/__init__.py 2010-01-02 10:07:14 +0000
+++ ibid/__init__.py 2010-01-02 16:04:12 +0000
@@ -49,6 +49,7 @@
49 for key, value in opts.items():49 for key, value in opts.items():
50 options[key] = value50 options[key] = value
51 options['base'] = dirname(options['config'])51 options['base'] = dirname(options['config'])
52 sys.path.insert(0, options['base'])
5253
53 # Get Twisted to log to Python logging54 # Get Twisted to log to Python logging
54 twisted.python.log.startLoggingWithObserver(twisted_log)55 twisted.python.log.startLoggingWithObserver(twisted_log)
5556
=== modified file 'ibid/core.py'
--- ibid/core.py 2009-12-30 22:01:38 +0000
+++ ibid/core.py 2010-01-02 16:04:12 +0000
@@ -180,6 +180,8 @@
180 noload = List of plugins / plugin.Processors to skip automatically loading180 noload = List of plugins / plugin.Processors to skip automatically loading
181 autoload = (Boolean) Load all plugins by default?181 autoload = (Boolean) Load all plugins by default?
182 """182 """
183 # Sets up twisted.python so that we can iterate modules
184 __import__('ibid.plugins')
183185
184 load = 'load' in ibid.config.plugins and ibid.config.plugins['load'] or []186 load = 'load' in ibid.config.plugins and ibid.config.plugins['load'] or []
185 noload = 'noload' in ibid.config.plugins and ibid.config.plugins['noload'] or []187 noload = 'noload' in ibid.config.plugins and ibid.config.plugins['noload'] or []
186188
=== modified file 'ibid/plugins/__init__.py'
--- ibid/plugins/__init__.py 2009-12-14 13:43:58 +0000
+++ ibid/plugins/__init__.py 2010-01-02 16:04:12 +0000
@@ -5,11 +5,14 @@
5import re5import re
66
7from twisted.spread import pb7from twisted.spread import pb
8from twisted.plugin import pluginPackagePaths
8from twisted.web import resource9from twisted.web import resource
910
10import ibid11import ibid
11from ibid.compat import json12from ibid.compat import json
1213
14__path__.extend(pluginPackagePaths(__name__))
15
13class Processor(object):16class Processor(object):
14 """Base class for Ibid plugins.17 """Base class for Ibid plugins.
15 Processors receive events and (optionally) do things with them.18 Processors receive events and (optionally) do things with them.
1619
=== modified file 'scripts/ibid-db'
--- scripts/ibid-db 2009-12-20 20:17:17 +0000
+++ scripts/ibid-db 2010-01-02 16:04:13 +0000
@@ -5,11 +5,13 @@
5import logging5import logging
6from optparse import OptionParser, OptionGroup6from optparse import OptionParser, OptionGroup
7from os.path import exists7from os.path import exists
8from sys import stdin, stdout, stderr, exit8from sys import path, stdin, stdout, stderr, exit
99
10from sqlalchemy import select, DateTime10from sqlalchemy import select, DateTime
11from twisted.python.modules import getModule11from twisted.python.modules import getModule
1212
13path.insert(0, '.')
14
13import ibid15import ibid
14from ibid.compat import json16from ibid.compat import json
15from ibid.config import FileConfig17from ibid.config import FileConfig
1618
=== modified file 'scripts/ibid-plugin'
--- scripts/ibid-plugin 2009-12-30 22:01:38 +0000
+++ scripts/ibid-plugin 2010-01-02 16:04:13 +0000
@@ -4,6 +4,7 @@
4from optparse import OptionParser4from optparse import OptionParser
5from os import getenv5from os import getenv
6from os.path import exists6from os.path import exists
7import sys
78
8try:9try:
9 import readline10 import readline
@@ -14,6 +15,8 @@
1415
15from sqlalchemy.exceptions import IntegrityError16from sqlalchemy.exceptions import IntegrityError
1617
18sys.path.insert(0, '.')
19
17import ibid20import ibid
18import ibid.plugins21import ibid.plugins
19from ibid.config import FileConfig22from ibid.config import FileConfig
2023
=== modified file 'scripts/ibid-setup'
--- scripts/ibid-setup 2009-12-20 20:17:17 +0000
+++ scripts/ibid-setup 2010-01-02 16:04:13 +0000
@@ -12,6 +12,8 @@
12from pkg_resources import resource_stream12from pkg_resources import resource_stream
13from twisted.python.modules import getModule13from twisted.python.modules import getModule
1414
15sys.path.insert(0, '.')
16
15import ibid17import ibid
16from ibid.config import FileConfig18from ibid.config import FileConfig
17from ibid.core import DatabaseManager19from ibid.core import DatabaseManager

Subscribers

People subscribed via source and target branches