forked from openlibhums/production_transporter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin_settings.py
More file actions
68 lines (53 loc) · 1.84 KB
/
plugin_settings.py
File metadata and controls
68 lines (53 loc) · 1.84 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
59
60
61
62
63
64
65
66
67
68
from utils import plugins
from utils.install import update_settings
from events import logic as events_logic
from plugins.production_transporter import utils
PLUGIN_NAME = 'Production Transporter'
DISPLAY_NAME = 'Production Transporter'
DESCRIPTION = 'Copies an article to an FTP server on acceptance.'
AUTHOR = 'Birkbeck, University of London'
VERSION = '0.1'
SHORT_NAME = 'production_transporter'
MANAGER_URL = 'production_transporter_manager'
JANEWAY_VERSION = "1.4.2"
IS_WORKFLOW_PLUGIN = True
HANDSHAKE_URL = 'production_transporter_handshake_url'
JUMP_URL = 'production_transporter_jump_url'
ARTICLE_PK_IN_HANDSHAKE_URL = False
STAGE = 'production_transporter'
KANBAN_CARD = 'production_transporter/elements/card.html'
class ProductionTransporterPlugin(plugins.Plugin):
plugin_name = PLUGIN_NAME
display_name = DISPLAY_NAME
description = DESCRIPTION
author = AUTHOR
short_name = SHORT_NAME
manager_url = MANAGER_URL
stage = STAGE
version = VERSION
janeway_version = JANEWAY_VERSION
is_workflow_plugin = IS_WORKFLOW_PLUGIN
handshake_url = HANDSHAKE_URL
article_pk_in_handshake_url = ARTICLE_PK_IN_HANDSHAKE_URL
jump_url = JUMP_URL
prod_transporter = ProductionTransporterPlugin()
def install():
prod_transporter.install()
update_settings(
file_path='plugins/production_transporter/install/settings.json'
)
def hook_registry():
prod_transporter.hook_registry()
def register_for_events():
events_logic.Events.register_for_event(
events_logic.Events.ON_ARTICLE_ACCEPTED,
utils.on_article_accepted,
)
events_logic.Events.register_for_event(
events_logic.Events.ON_ARTICLE_SUBMITTED,
utils.on_article_submitted,
)
events_logic.Events.register_for_event(
events_logic.Events.ON_ARTICLE_PUBLISHED,
utils.on_article_published,
)