-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin_settings.py
More file actions
58 lines (45 loc) · 1.39 KB
/
plugin_settings.py
File metadata and controls
58 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from django.conf import settings
from utils import plugins
from events import logic as events_logic
from plugins.datacite import utils
from utils.install import update_settings
PLUGIN_NAME = 'Datacite Plugin'
DISPLAY_NAME = 'Datacite'
DESCRIPTION = 'Datacite DOI Deposit TOol.'
AUTHOR = 'Andy Byers'
VERSION = '0.5'
SHORT_NAME = 'datacite'
MANAGER_URL = 'datacite_articles'
JANEWAY_VERSION = "1.8.0"
DATACITE_USERNAME = ''
DATACITE_PASSWORD = ''
DATACITE_PREFIX = ''
DATACITE_API_URL = 'https://api.datacite.org/dois'
JOURNAL_PREFIX = True
if settings.DEBUG:
DATACITE_API_URL = 'https://api.test.datacite.org/dois' # Use test in debug mode.
class DatacitePlugin(plugins.Plugin):
plugin_name = PLUGIN_NAME
display_name = DISPLAY_NAME
description = DESCRIPTION
author = AUTHOR
short_name = SHORT_NAME
manager_url = MANAGER_URL
version = VERSION
janeway_version = JANEWAY_VERSION
def install():
DatacitePlugin.install()
update_settings(
file_path='plugins/datacite/install/settings.json'
)
def hook_registry():
DatacitePlugin.hook_registry()
def register_for_events():
events_logic.Events.register_for_event(
events_logic.Events.ON_ARTICLE_ACCEPTED,
utils.register_doi_automatically,
)
events_logic.Events.register_for_event(
events_logic.Events.ON_ARTICLE_PUBLISHED,
utils.publish_doi_automatically,
)