Changeset - 5e43626fccc0
[Not reviewed]
Merge default
0 3 0
Dennis Fink - 9 years ago 2016-05-16 21:13:29
dennis.fink@c3l.lu
Merged dev
3 files changed with 12 insertions and 9 deletions:
0 comments (0 inline, 0 general)
ennstatus/api/views.py
Show inline comments
 
@@ -106,33 +106,34 @@ def update():
 

	
 
    data['country'] = country
 
    data['last_updated'] = strict_rfc3339.timestamp_to_rfc3339_utcoffset(
 
        datetime.utcnow().timestamp()
 
    )
 

	
 
    try:
 
        server = Server.from_dict(data)
 
    except Exception as e:
 
        current_app.logger.warning(' '.join([str(e), str(data)]))
 
        return str(e), 409, {'Content-Type': 'text/plain'}
 

	
 
    try:
 
        server.update_weights()
 
    except NotImplementedError:
 
        pass
 
    if current_app.config['ENNSTATUS_ENABLE_ONIONOO']:
 
        try:
 
            server.update_weights()
 
        except NotImplementedError:
 
            pass
 

	
 
    try:
 
        server.update_flags()
 
    except NotImplementedError:
 
        pass
 
        try:
 
            server.update_flags()
 
        except NotImplementedError:
 
            pass
 

	
 
    try:
 
        server.save()
 
    except Exception as e:
 
        current_app.logger.error(str(e))
 
        return str(e), 500, {'Content-Type': 'text/plain'}
 

	
 
    current_app.logger.info('Return result')
 
    return (
 
        server.json(), 201,
 
        {
 
            'Location': '/api/export/json/single?server_name={}'.format(
ennstatus/config.py
Show inline comments
 
@@ -27,12 +27,14 @@ def init_app(app):
 
    config['SECRET_KEY'] = os.environ.get('SECRET_KEY', _default_secret_key)
 

	
 
    # Flask-Bootstrap
 
    config.setdefault('BOOTSTRAP_SERVE_LOCAL', True)
 

	
 
    # ennstatus
 

	
 
    # moment.js string formatting
 
    # http://momentjs.com/docs/#/displaying/format/
 
    config.setdefault('ENNSTATUS_MOMENTJS_FORMAT', 'DD MMMM YYYY HH:mm:ss')
 

	
 
    config.setdefault('ENNSTATUS_STRFTIME_FORMAT', '%d %B %Y %H:%M:%S')
 

	
 
    config.setdefault('ENNSTATUS_ENABLE_ONIONOO', False)
setup.py
Show inline comments
 
@@ -2,25 +2,25 @@ from setuptools import setup, find_packa
 

	
 

	
 
def _get_requirements():
 

	
 
    with open('requirements.in', encoding='utf-8') as f:
 
        lines = f.readlines()
 

	
 
    lines = [line[:-1] for line in lines if not line.startswith('#')]
 
    return lines
 

	
 

	
 
setup(name='Ennstatus',
 
      version='5.4.7',
 
      version='5.5.0',
 
      description=('Ennstatus provides the user with vital information about '
 
                   'the status of the organizations Tor servers.'),
 
      author='Frënn vun der Ënn',
 
      author_email='info@enn.lu',
 
      url='https://bitbucket.org/fvde/ennstatus',
 
      license='GPLv3+',
 
      packages=find_packages(),
 
      install_requires=_get_requirements(),
 
      include_package_data=True,
 
      entry_points={
 
          'console_scripts': [
 
              'ennstatuscli = ennstatus.cli:cli',
0 comments (0 inline, 0 general)