176 Commits

Author SHA1 Message Date
Doug Hellmann
7943bb2029 Add structure for tutorial
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 17:25:23 -04:00
Doug Hellmann
9136939760 Add PyCon 2013 essay
Add an essay based on my PyCon 2013 presentation.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 17:25:01 -04:00
Doug Hellmann
7e7f9c7c5f Update docs for NameDispatchExtensionManager
Add missing parameter to the table.

Resolves issue #13

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 11:00:13 -04:00
Doug Hellmann
fd365c497a Clean up autodoc for manager classes
Use default settings instead of repeating the options
for each class.

Add docstrings for special methods that do not have them
so they appear in the output.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 10:56:04 -04:00
Doug Hellmann
69e17801a3 Add ExtensionManager.__getitem__
Allow extensions to be accessed directly by name.

Fixes issue #15

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 10:54:49 -04:00
Doug Hellmann
52572efd4a Change sort for NamedExtensionManager
Use a less expensive algorithm for ordering the
extensions.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 10:02:53 -04:00
Doug Hellmann
c334f4981b Ignore missing extensions in named dispatch
If the NamedDispatchExtensionManager is told to invoke
and extension that it has not loaded, log the condition
but otherwise ignore it.

Resolves issue #14

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 09:54:19 -04:00
Doug Hellmann
7e967386c4 Set up extlinks extension
Configure the extlinks extension to make it easy to link
to issues from the documentation.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-03 09:53:34 -04:00
Doug Hellmann
ae2d9addea document new name_order param in history
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-05-19 12:25:08 -04:00
Doug Hellmann
abf23bc0e9 Correct argument types in name sort tests
The "names" argument is supposed to be a list, not a
single string.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-05-19 12:22:48 -04:00
Doug Hellmann
8f111e0235 Merge pull request #12 from drocco-007/master
NamedExtensionManager can optionally order loaded extensions to match the names parameter.
2013-05-19 09:21:43 -07:00
Doug Hellmann
5b937bc89c fix type definition of names parameter
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-05-18 13:46:26 -04:00
Daniel Rocco
41388cd070 optionally sort named extensions
NamedExtensionManager can optionally order loaded extensions to match the
names parameter.
2013-05-17 23:25:22 -04:00
Doug Hellmann
ab58eaa0a4 Merge pull request #11 from dhellmann/travis-config
Add travis-ci configuration file
2013-05-05 08:55:06 -07:00
Doug Hellmann
8040e7617b flake8 fixes
Minor style changes to make flake8 pass.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-05-05 11:52:40 -04:00
Doug Hellmann
d05bcea552 Add travis-ci configuration file
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-05-05 11:39:33 -04:00
Doug Hellmann
0c356d215f add python 3.3 support tag
Change-Id: I463dbfb0c861da9d4226bdc760164a2f482e51fe
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-03-26 16:58:56 -04:00
Doug Hellmann
c3e3002f8b add python 3.3 setup to tox
Change-Id: Ida90b57d4dd6464bde38b08362d40488669b76ab
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-03-26 16:46:49 -04:00
Doug Hellmann
5eea466dca link to docs from README
Addresses #7

Change-Id: I0c96eb8a26e0c3acb771efc1a70e20b3539c3387
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-02-18 17:19:13 -05:00
Doug Hellmann
fb5e8cc2fe update settings for 0.8 release
Change-Id: I15c465d1c4883d6db08638bbe5ed1f83a82477b5
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.8
2013-01-04 19:17:11 -05:00
Doug Hellmann
83098c78d0 Check the names of plugins before importing them
Update NamedExtensionManager to check the names of the plugins
before loading any code to avoid importing anything we are not going
to use.

Fixes issue #4

Change-Id: I27b19cb42ca3d165ce45953281b82e394c4539a2
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-01-04 19:14:21 -05:00
Doug Hellmann
42fbe31c4f fix typo in docstring
Change-Id: Ide52b81d292e16ab086acf7d5f93b579bf233b1d
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-01-04 19:14:00 -05:00
Doug Hellmann
c89446fbdc Let AssertionErrors bubble up
Sometimes we want to use AssertionError to cause test
failures, and it is unlikely to be used in real code,
so just let the error bubble up if it is encountered
while loading a plugin.

Change-Id: I7ad20b0796c1a02427d324aa7f35bb238013c425
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-01-04 19:12:54 -05:00
Doug Hellmann
0a51bfd008 prep for release 0.7.2
Change-Id: I2ea8d2443860c64bc5f8e9474b9326e1d3dac39c
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.7.2
2012-11-28 06:23:18 -05:00
Doug Hellmann
e7259f89ad fix logging support under python 2.6
Change-Id: I2badb7a5a8f8f2c49eb29ced5ce2e6c745f20af1
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-11-28 06:22:50 -05:00
Doug Hellmann
13d4b56970 Run tests under python 2.6
Change-Id: I7efd7f3c014159b513db52467175b25d473c4fdf
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-11-28 06:21:48 -05:00
Doug Hellmann
1a88f60328 Fix logging configuration
Set up a NullHandler to avoid warnings when applications
do not configure a root logger.

Change-Id: I6cd957396c5e3ad706aea812874ab43fdd9e8aea
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.7.1
2012-11-27 14:32:44 -05:00
Doug Hellmann
589dd73fc7 prepare release 0.7
Change-Id: Ic9c619a2cbcdb1cef52fedbf18f677377fbdd212
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.7
2012-11-26 12:44:41 -05:00
markmcclain
2106ab5e26 Merge pull request #3 from dhellmann/feature/cache-entry-points
Cache the entry points discovered within a namespace
2012-11-26 09:26:21 -08:00
Doug Hellmann
7bdc14c620 Cache the entry points discovered within a namespace
Scanning the entry point registry is relatively expensive
and causes performance issues with unit tests of code
depending on stevedore. This change addresses the
performance issues by caching the entry points as
they are loaded from pkg_resources in a class attribute
in the base class of the extension managesr so they can
be reused by other instances.

Change-Id: Iba7bee6790cdedc94cb537e2ed6e12219c85f26a
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-11-26 12:13:37 -05:00
Doug Hellmann
b01eb69915 Bump version to 0.6
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.6
2012-10-29 11:38:27 -04:00
Doug Hellmann
3c64c7b71a Load extensions before checking enabled status
Go ahead and load the extension entry point so the
check function can interrogate it about whether it
should be enabled or not.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-29 10:47:43 -04:00
Doug Hellmann
1ffbe0c6bb Fix line lengths for pep8
Re-enable the line limit checking in pep8 and then fix the
issues with modules that had long lines.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-29 10:46:30 -04:00
Doug Hellmann
502f552849 Prepare for 0.5 release
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.5
2012-10-29 09:27:43 -04:00
Doug Hellmann
9090fa09ea Add TestExtensionManager
Create a special extension manager class that uses pre-configured
extension instances instead of loading them from a plugin set.
This makes setting up controlled environments for testing much
easier.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-29 09:23:35 -04:00
Doug Hellmann
90314340fd Add driver property to DriverManager
Provide an easy way to get direct access to the driver
that was loaded for callers that don't want to use
the __call__() API, or who need richer access to the
object.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.4
2012-09-15 16:25:22 -04:00
Doug Hellmann
1e21f320b2 Prepare release 0.4
Update the history file and version number.

Change-Id: Ia09d4a9316dcc77775124f298ddde535707cfa0c
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-15 16:10:28 -04:00
Doug Hellmann
8b0e71d3a9 Remove the name argument to extension constructors.
Do not force plugins to take an argument with their name.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-15 16:06:34 -04:00
Doug Hellmann
d32fa18efe fix inheritence hierarchy of DriverManager
Change-Id: I4c85d42a800186da4beeac13acd7a07d4223fa90
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-13 07:21:24 -04:00
Doug Hellmann
cfb1f11ea7 Set up logging in enabled module
Change-Id: Id2fc37942a32ab7b43c32b834e50940594f12e38
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-13 07:20:08 -04:00
Doug Hellmann
55ce6e4261 Log the full exception when plugin load fails
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-09-13 07:19:20 -04:00
Doug Hellmann
401a1e404c Optimize implementation of NameDispatchExtensionManager
Create a dictionary mapping names to extensions so the
NameDispatchExtensionManager can just iterate over the
ones that will be invoked instead of all of the loaded
plugins.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-21 11:36:57 -04:00
Doug Hellmann
a9de3ecc55 Add response callback to _invoke_one_plugin().
Change the response list argument to _invoke_one_plugin()
to a callback that accepts the response value.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-21 11:35:05 -04:00
Doug Hellmann
79bd21f43d Refactor code for invoking plugins from map().
Create a method _invoke_one_plugin() to call the plugin and
append the results to a list to be returned.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-21 11:29:38 -04:00
Doug Hellmann
60c88f6cf2 clean up formatting
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-15 07:36:42 -04:00
Doug Hellmann
633e75758e make DriverManager callable
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
0.3
2012-08-15 07:27:54 -04:00
Doug Hellmann
a40785c915 add download link
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-15 07:21:43 -04:00
Doug Hellmann
d3ee2254d6 clean up announcement text
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-15 07:21:34 -04:00
Doug Hellmann
761e9cde26 add installation instructions
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-15 07:18:33 -04:00
Doug Hellmann
90823ebcf4 update history for 0.3 release
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-08-15 07:18:15 -04:00