[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r10273 - in trunk/gnue-common: . src/base
From: |
reinhard |
Subject: |
[gnue] r10273 - in trunk/gnue-common: . src/base |
Date: |
Thu, 16 Dec 2010 15:22:17 -0600 (CST) |
Author: reinhard
Date: 2010-12-16 15:22:17 -0600 (Thu, 16 Dec 2010)
New Revision: 10273
Modified:
trunk/gnue-common/
trunk/gnue-common/src/base/plugin.py
Log:
Moved exception to the end of the file.
Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
- timestamp: 2010-12-03 00:59:15.023999929 +0100
committer: Reinhard Müller <address@hidden>
properties:
branch-nick: common
+ timestamp: 2010-12-16 22:21:53.016000032 +0100
committer: Reinhard Müller <address@hidden>
properties:
branch-nick: common
Name: bzr:file-ids
- src/base/tree.py address@hidden:trunk%2Fgnue-common:src%2Fbase%2Ftree.py
+ src/base/plugin.py
address@hidden:trunk%2Fgnue-common:src%2Fbase%2Fplugin.py
Name: bzr:revision-id:v4
- 3116 address@hidden
3117 address@hidden
3118 address@hidden
3119 address@hidden
3120 address@hidden
3121 address@hidden
3122 address@hidden
3123 address@hidden
3124 address@hidden
3125 address@hidden
3126 address@hidden
3127 address@hidden
3128 address@hidden
3129 address@hidden
3130 address@hidden
3131 address@hidden
3132 address@hidden
3133 address@hidden
3134 address@hidden
3135 address@hidden
3136 address@hidden
3137 address@hidden
3138 address@hidden
3139 address@hidden
3140 address@hidden
3141 address@hidden
3142 address@hidden
3143 address@hidden
3144 address@hidden
3145 address@hidden
3146 address@hidden
+ 3116 address@hidden
3117 address@hidden
3118 address@hidden
3119 address@hidden
3120 address@hidden
3121 address@hidden
3122 address@hidden
3123 address@hidden
3124 address@hidden
3125 address@hidden
3126 address@hidden
3127 address@hidden
3128 address@hidden
3129 address@hidden
3130 address@hidden
3131 address@hidden
3132 address@hidden
3133 address@hidden
3134 address@hidden
3135 address@hidden
3136 address@hidden
3137 address@hidden
3138 address@hidden
3139 address@hidden
3140 address@hidden
3141 address@hidden
3142 address@hidden
3143 address@hidden
3144 address@hidden
3145 address@hidden
3146 address@hidden
3147 address@hidden
Name: bzr:text-parents
- src/base/tree.py
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:10118
+ src/base/plugin.py
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:10035
Modified: trunk/gnue-common/src/base/plugin.py
===================================================================
--- trunk/gnue-common/src/base/plugin.py 2010-12-16 20:56:25 UTC (rev
10272)
+++ trunk/gnue-common/src/base/plugin.py 2010-12-16 21:22:17 UTC (rev
10273)
@@ -63,46 +63,14 @@
from types import ModuleType
from gnue.common.base import errors
-__all__ = ['LoadError', 'list_plugins', 'find']
+__all__ = ['list_plugins', 'find', 'LoadError']
+
# =============================================================================
-# Exceptions
+# Global functions
# =============================================================================
# -----------------------------------------------------------------------------
-# Module loading error
-# -----------------------------------------------------------------------------
-
-class LoadError(errors.AdminError):
- """
- Indicates a failure to load a given module. Raised by L{find}.
-
- If e is an Exception of this class, e.exceptions gives a dictionary with
- the keys being the modules that were trying to be imported and the values
- being the exception info tuples for the exception that happened trying, and
- e.detail is a string containing basically the same info.
- """
- def __init__(self, name, exceptions):
-
- self.name = name
- self.exceptions = exceptions
-
- if self.exceptions:
- message = u_("Cannot load plugin '%s'") % self.name
- detail = u_("The following plugins failed:\n")
- for (name, exc) in self.exceptions.items():
- detail += u"* %s: %s" % (name, exc)
- else:
- message = u_("Cannot find plugin '%s'") % self.name
- detail = None
-
- errors.AdminError.__init__(self, message)
-
- if detail:
- self.detail = detail
-
-
-# -----------------------------------------------------------------------------
# List all available plugins
# -----------------------------------------------------------------------------
@@ -355,6 +323,39 @@
# =============================================================================
+# Exceptions
+# =============================================================================
+
+class LoadError(errors.AdminError):
+ """
+ Indicates a failure to load a given module. Raised by L{find}.
+
+ If e is an Exception of this class, e.exceptions gives a dictionary with
+ the keys being the modules that were trying to be imported and the values
+ being the exception info tuples for the exception that happened trying, and
+ e.detail is a string containing basically the same info.
+ """
+ def __init__(self, name, exceptions):
+
+ self.name = name
+ self.exceptions = exceptions
+
+ if self.exceptions:
+ message = u_("Cannot load plugin '%s'") % self.name
+ detail = u_("The following plugins failed:\n")
+ for (name, exc) in self.exceptions.items():
+ detail += u"* %s: %s" % (name, exc)
+ else:
+ message = u_("Cannot find plugin '%s'") % self.name
+ detail = None
+
+ errors.AdminError.__init__(self, message)
+
+ if detail:
+ self.detail = detail
+
+
+# =============================================================================
# Self test code
# =============================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r10273 - in trunk/gnue-common: . src/base,
reinhard <=