mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Bilingual meta classes
This commit is contained in:
parent
6e52b5eb70
commit
bad5582632
1 changed files with 4 additions and 9 deletions
|
@ -32,15 +32,10 @@ class PluginMeta(type):
|
|||
else:
|
||||
return ', '.join(plugin_names[:-1]) + ", or " + plugin_names[-1]
|
||||
|
||||
|
||||
class BaseExporter(object):
|
||||
__metaclass__ = PluginMeta
|
||||
names = []
|
||||
|
||||
|
||||
class BaseImporter(object):
|
||||
__metaclass__ = PluginMeta
|
||||
names = []
|
||||
# This looks a bit arcane, but is basically bilingual speak for defining a
|
||||
# class with meta class 'PluginMeta' for both Python 2 and 3.
|
||||
BaseExporter = PluginMeta(str('BaseExporter'), (), {'names': []})
|
||||
BaseImporter = PluginMeta(str('BaseImporter'), (), {'names': []})
|
||||
|
||||
|
||||
for module in glob.glob(os.path.dirname(__file__) + "/*.py"):
|
||||
|
|
Loading…
Add table
Reference in a new issue