Skip to content

Commit

Permalink
Merge pull request #65 from marwoodandrew/sd-5046
Browse files Browse the repository at this point in the history
[SD-5046] Add AAP specific IPTC subject codes
  • Loading branch information
Mayur Dhamanwala authored Jul 28, 2016
2 parents c5a1396 + bec9f48 commit 839932b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
11 changes: 11 additions & 0 deletions server/aap/io/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

import aap.io.iptc_extension # noqa
1 change: 1 addition & 0 deletions server/aap/io/data/aap_subject_codes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"99000000": "editorial", "99001000": "advisory", "99002000": "briefings", "99003000": "diary", "99004000": "filing", "99005000": "highlights", "99006000": "service", "99007000": "staff", "99008000": "style", "99009000": "system"}
27 changes: 27 additions & 0 deletions server/aap/io/iptc_extension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

"""IPTC module"""

import os
from datetime import datetime
from superdesk.io.iptc import load_codes
from superdesk.io.iptc import subject_codes


dirname = os.path.dirname(os.path.realpath(__file__))
data_subject_codes = os.path.join(dirname, 'data', 'aap_subject_codes.json')
aap_subject_codes = load_codes(data_subject_codes)


def init_app(app):
last_modified = datetime(2016, 7, 28)
app.subjects.register(aap_subject_codes, last_modified)
subject_codes.update(aap_subject_codes)
3 changes: 2 additions & 1 deletion server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def env(variable, fallback_value=None):
'aap.publish.formatters',
'aap_mm',
'aap.io.feed_parsers',
'aap.data_consistency'
'aap.data_consistency',
'aap.io.iptc_extension'
])

RENDITIONS = {
Expand Down

0 comments on commit 839932b

Please sign in to comment.