Browse Source

Don't repeat module name in class names

Alois Mahdal 10 years ago
parent
commit
776b48ca1e
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      include/sardine.py

+ 6
- 6
include/sardine.py View File

@@ -5,11 +5,11 @@ import os
5 5
 import sys
6 6
 
7 7
 
8
-class SardinePluginError(Exception):
8
+class PluginError(Exception):
9 9
     pass
10 10
 
11 11
 
12
-class SardinePluginUsageError(SardinePluginError):
12
+class PluginUsageError(PluginError):
13 13
     pass
14 14
 
15 15
 
@@ -41,7 +41,7 @@ class BasePlugin(object):
41 41
         method_n = "render_" + self.data.fmt
42 42
 
43 43
         def ex(__):
44
-            raise SardinePluginError("plugin method not defined: " + method_n)
44
+            raise PluginError("plugin method not defined: " + method_n)
45 45
 
46 46
         render_fn = getattr(self, method_n, ex)
47 47
         return render_fn()
@@ -84,7 +84,7 @@ class Subcommand(object):
84 84
                 module = imp.load_module(self.name, fh, modpath,
85 85
                                          (".py", "r", imp.PY_SOURCE))
86 86
         except IOError:
87
-            raise SardinePluginError("no such plugin: %s" % self.name)
87
+            raise PluginError("no such plugin: %s" % self.name)
88 88
         self.plugin = module.Plugin(self.plugindata)
89 89
 
90 90
     def _format_output(self, raw):
@@ -125,9 +125,9 @@ class App:
125 125
         try:
126 126
             self.subcommand = Subcommand(self.cmdargs, self.pluginpath)
127 127
             print self.subcommand.get_output()
128
-        except SardinePluginUsageError as e:
128
+        except PluginUsageError as e:
129 129
             msg = ("plugin usage: %s %s %s"
130 130
                    % (self.name, self.subcommand.name, e))
131 131
             self.die(msg, 11)
132
-        except SardinePluginError as e:
132
+        except PluginError as e:
133 133
             self.die(e, 10)