Skip to content

Commit

Permalink
Merge pull request #657 from petrjasek/1.4
Browse files Browse the repository at this point in the history
update 1.4
  • Loading branch information
petrjasek committed Nov 15, 2016
2 parents 8a3953f + 86e6ada commit 16d9737
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 23 deletions.
1 change: 1 addition & 0 deletions apps/highlights/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ def create(self, docs, **kwargs):

return ids


package.package_create_signal.connect(on_create_package)
1 change: 1 addition & 0 deletions apps/ldap/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ def run(self, ad_username, ad_password, username, admin='false'):

return user_data


superdesk.command('users:copyfromad', ImportUserProfileFromADCommand())
52 changes: 52 additions & 0 deletions apps/prepopulate/data_init/validators.json
Original file line number Diff line number Diff line change
Expand Up @@ -1518,5 +1518,57 @@
"allowed": [1, 2, 3, 4, 5, 6, 7, 8, 9]
}
}
},
{
"_id": "publish_embedded_picture",
"act": "publish",
"type": "picture",
"embedded": true,
"schema": {
"type": {
"type": "string",
"required": true,
"allowed": ["picture"]
},
"pubstatus": {
"type": "string",
"required": true,
"allowed": ["usable"]
},
"renditions": {
"type": "dict",
"required": true
},
"description_text": {
"type": "string",
"required": true
}
}
},
{
"_id": "correct_embedded_picture",
"act": "correct",
"type": "picture",
"embedded": true,
"schema": {
"type": {
"type": "string",
"required": true,
"allowed": ["picture"]
},
"pubstatus": {
"type": "string",
"required": true,
"allowed": ["usable"]
},
"renditions": {
"type": "dict",
"required": true
},
"description_text": {
"type": "string",
"required": true
}
}
}
]
1 change: 1 addition & 0 deletions apps/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,5 @@ def _stage_changed(self, updates, original):
old_stage_id = str(original.get('task', {}).get('stage', ''))
return new_stage_id and new_stage_id != old_stage_id


superdesk.privilege(name='tasks', label='Tasks Management', description='Tasks Management')
42 changes: 22 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,32 @@
'eve-elastic>=0.3.8,<0.4',
'elasticsearch==1.9.0',
'flask>=0.10,<0.11',
'flask-mail>=0.9',
'flask-script>=2.0.5',
'pillow>=3.0',
'arrow>=0.4',
'asyncio>=3.4',
'bcrypt>=3.1.1',
'beautifulsoup4>=4.4',
'blinker>=1.3',
'flask-mail>=0.9,<0.10',
'flask-script>=2.0.5,<3.0',
'flask-sentinel>=0.0.4,<0.1',
'flask-oauthlib>=0.9.1,<0.10',
'pillow>=3.0,<3.5',
'arrow>=0.4,<0.9',
'asyncio>=3.4,<3.5',
'bcrypt>=3.1.1,<3.2',
'beautifulsoup4>=4.4,<4.6',
'blinker>=1.3,<1.5',
'celery[redis]>=3.1.18,<4',
'feedparser>=5.2',
'hachoir3-superdesk>=3.0a1',
'feedparser>=5.2,<5.3',
'hachoir3-superdesk>=3.0a1,<3.1',
'HermesCache>=0.6.0,<0.7.0',
'python-magic>=0.4',
'python3-ldap>=0.9.8',
'python-magic>=0.4,<0.5',
'python3-ldap>=0.9.8,<0.9.9',
'pytz>=2015.4',
'tzlocal>=1.2.2',
'tzlocal>=1.2.2,<1.4',
'raven[flask]>=5.10,<6.0',
'requests>=2.7.0',
'statsd>=3.1',
'httmock>=1.2.3',
'boto3>=1.1.4',
'websockets>=2.6',
'mongolock>=1.3.4',
'PyYAML>=3.11',
'requests>=2.7.0,<2.13',
'statsd>=3.1,<3.3',
'httmock>=1.2.3,<1.3',
'boto3>=1.1.4,<1.5',
'websockets>=2.6,<3.3',
'mongolock>=1.3.4,<1.4',
'PyYAML>=3.11,<3.13',
]

package_data = {
Expand Down
1 change: 1 addition & 0 deletions superdesk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def get_headers(self, environ=None):
('Access-Control-Allow-Headers', '*'),
]


setattr(HTTPException, 'get_headers', get_headers)


Expand Down
1 change: 1 addition & 0 deletions superdesk/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,5 @@ def get_recipients(user_list, activity_name):

return recipients


add_notifier(notify_and_add_activity)
1 change: 1 addition & 0 deletions superdesk/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def on_failure(self, exc, task_id, args, kwargs, einfo):
with superdesk.app.app_context():
handle_exception(exc)


celery.Task = AppContextTask


Expand Down
1 change: 1 addition & 0 deletions superdesk/commands/delete_text_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ def run(self, guids=[], file=None):

self.single_delete(data['guid'])


superdesk.command('app:deletedoc', DeleteDocCommand())
1 change: 1 addition & 0 deletions superdesk/commands/rebuild_elastic_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ def run(self, index_name=None):
def _get_available_indexes(self):
return SearchService(None, None).get_available_indexes()


superdesk.command('app:rebuild_elastic_index', RebuildElasticIndex())
6 changes: 3 additions & 3 deletions superdesk/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def env(variable, fallback_value=None):
else:
return env_value

ABS_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))
BEHAVE_TESTS_FIXTURES_PATH = os.path.join(ABS_PATH, # default value: `features/steps/fixtures`
'features', 'steps', 'fixtures')

ABS_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
BEHAVE_TESTS_FIXTURES_PATH = ABS_PATH + '/features/steps/fixtures'

XML = False
IF_MATCH = True
Expand Down
1 change: 1 addition & 0 deletions superdesk/io/commands/add_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ def run(self, provider=None):
except Exception as ex:
raise ProviderError.providerAddError(ex, data)


superdesk.command('ingest:provider', AddProvider())
1 change: 1 addition & 0 deletions superdesk/io/feed_parsers/afp_newsml_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def parse(self, xml, provider=None):
item['versioncreated'] = utc.localize(item['versioncreated']) if item.get('versioncreated') else utcnow()
return item


register_feed_parser(AFPNewsMLOneFeedParser.NAME, AFPNewsMLOneFeedParser())
1 change: 1 addition & 0 deletions superdesk/io/feed_parsers/dpa_iptc7901.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ def dpa_derive_dateline(self, item):
break
return item


register_feed_parser(DPAIPTC7901FeedParser.NAME, DPAIPTC7901FeedParser())
1 change: 1 addition & 0 deletions superdesk/io/feed_parsers/pa_nitf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ def parse(self, xml, provider=None):
self.xml = xml
return super().parse(xml, provider=provider)


register_feed_parser(PAFeedParser.NAME, PAFeedParser())
1 change: 1 addition & 0 deletions superdesk/io/feed_parsers/scoop_newsml_2_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ def parse_inline_content(self, tree):
content['content'] = "\n".join(elements)
return content


register_feed_parser(ScoopNewsMLTwoFeedParser.NAME, ScoopNewsMLTwoFeedParser())
1 change: 1 addition & 0 deletions superdesk/macros/abstract_populator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def populate(item, **kwargs):

return item


name = 'populate_abstract'
label = 'Populate Abstract'
order = 3
Expand Down
1 change: 1 addition & 0 deletions superdesk/macros/take_key_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def validate(item, **kwargs):

return item


name = 'take_key_validator'
label = 'validate take key'
callback = validate
Expand Down
1 change: 1 addition & 0 deletions superdesk/publish/transmitters/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ def _transmit(self, queue_item, subscriber):
except Exception as ex:
raise PublishEmailError.emailError(ex, queue_item.get('destination'))


register_transmitter('email', EmailPublishService(), errors)
1 change: 1 addition & 0 deletions superdesk/publish/transmitters/ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ def _transmit(self, queue_item, subscriber):
except Exception as ex:
raise PublishFtpError.ftpError(ex, config)


register_transmitter('ftp', FTPPublishService(), errors)
1 change: 1 addition & 0 deletions superdesk/publish/transmitters/http_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@ def _raise_publish_error(self, status_code, e, destination=None):
else:
raise PublishHTTPPushError.httpPushError(e, destination)


register_transmitter('http_push', HTTPPushService(), errors)
1 change: 1 addition & 0 deletions superdesk/publish/transmitters/odbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ def _CallStoredProc(self, conn, procName, paramDict):
else:
return 1


if pyodbc_available:
register_transmitter('ODBC', ODBCPublishService(), errors)
1 change: 1 addition & 0 deletions superdesk/storage/amazon/amazon_media_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def url_for_media_partial(app, media_id):
url = '%s/%s' % (str(app.config.get('AMAZON_PROXY_SERVER')), media_id)
return '%s://%s' % (protocol, url)


url_generators = {
'default': url_for_media_default,
'partial': url_for_media_partial
Expand Down
2 changes: 2 additions & 0 deletions superdesk/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ def inner(*a, **kw):
return use_snapshot.cache[fn]
return inner
return wrapper


use_snapshot.cache = {}


Expand Down
1 change: 1 addition & 0 deletions superdesk/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def env(variable, fallback_value=None):
else:
return env_value


ABS_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))
BEHAVE_TESTS_FIXTURES_PATH = os.path.join(ABS_PATH, # default value: `features/steps/fixtures`
'features', 'steps', 'fixtures')
Expand Down
1 change: 1 addition & 0 deletions superdesk/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def create_server(config):
except:
logger.exception('Failed to start the WebSocket server.')


if __name__ == '__main__':
config = {
'WS_HOST': '0.0.0.0',
Expand Down

0 comments on commit 16d9737

Please sign in to comment.