#339 Fix all flake8 errors
Merged 7 years ago by abompard. Opened 7 years ago by abompard.
abompard/fedora-hubs flake8  into  develop

file modified
-1
@@ -16,7 +16,6 @@ 

  from __future__ import unicode_literals, print_function

  

  import sys

- import dogpile.cache

  

  import hubs.app

  import hubs.widgets

file modified
+4 -4
@@ -13,14 +13,14 @@ 

  Authors:    Ralph Bean <rbean@redhat.com>

  """

  

- from __future__ import unicode_literals

+ from __future__ import unicode_literals, print_function

+ 

+ import retask

  

  import fedmsg.config

  config = fedmsg.config.load_config()

  

- import retask

- 

  for item in ['triage', 'work']:

      queue = retask.queue.Queue(config['hubs.redis.%s-queue-name' % item])

      queue.connect()

-     print ' (%s) queue length is %i' % (item, queue.length)

+     print(' (%s) queue length is %i' % (item, queue.length))

file modified
+9 -10
@@ -4,32 +4,31 @@ 

  Useful for testing what happens when you recreate them.

  """

  

- from __future__ import unicode_literals

- 

- import sys

+ from __future__ import unicode_literals, print_function

  

  import fedmsg.config

- fedmsg_config = fedmsg.config.load_config()

  

  import hubs.models

  

+ fedmsg_config = fedmsg.config.load_config()

+ 

  session = hubs.models.init(fedmsg_config['hubs.sqlalchemy.uri'])

  

- username = raw_input('What user do you want to delete: ')

+ username = input('What user do you want to delete: ')

  openid = '%s.id.fedoraproject.org' % username

- print "Looking for account %r" % openid

+ print("Looking for account %r" % openid)

  user = hubs.models.User.get(openid)

  if not user:

-     print "No such user %r" % openid

+     print("No such user %r" % openid)

  else:

-     print "Found %r.  Deleting." % user

+     print("Found %r.  Deleting." % user)

      session.delete(user)

  

  hub = hubs.models.Hub.get(username)

  if not hub:

-     print "No such hub %r" % username

+     print("No such hub %r" % username)

  else:

-     print "Found %r.  Deleting." % hub

+     print("Found %r.  Deleting." % hub)

      session.delete(hub)

  

  session.commit()

file modified
+2 -2
@@ -150,8 +150,8 @@ 

  # html_logo = None

  

  # The name of an image file (relative to this directory) to use as a favicon of

- # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32

- # pixels large.

+ # the docs.  This file should be a Windows icon file (.ico) being 16x16 or

+ # 32x32 pixels large.

  #

  # html_favicon = None

  

file modified
+4 -6
@@ -17,8 +17,6 @@ 

  #

  # Authors:  Ralph Bean <rbean@redhat.com>

  

- import os

- 

  config = dict(

      # Set this to dev if you're hacking on fedmsg or an app.

      # Set to stg or prod if running in the Fedora Infrastructure
@@ -28,14 +26,14 @@ 

      high_water_mark=0,

      io_threads=1,

  

-     ## For the fedmsg-hub and fedmsg-relay. ##

+     # # For the fedmsg-hub and fedmsg-relay. # #

  

      # This is a status dir to keep a record of the last processed message

-     #status_directory=os.getcwd() + "/status",

-     #status_directory='/var/run/fedmsg/status',

+     # status_directory=os.getcwd() + "/status",

+     # status_directory='/var/run/fedmsg/status',

  

      # This is the URL of a datagrepper instance that we can query for backlog.

-     #datagrepper_url="https://apps.fedoraproject.org/datagrepper/raw",

+     # datagrepper_url="https://apps.fedoraproject.org/datagrepper/raw",

  

      # We almost always want the fedmsg-hub to be sending messages with zmq as

      # opposed to amqp or stomp.

file modified
+4 -2
@@ -21,7 +21,8 @@ 

          ]

      },

  

-     'datanommer.sqlalchemy.uri': 'postgres://postgres:laksjdf@127.0.0.1/datanommer',

+     'datanommer.sqlalchemy.uri':

+         'postgres://postgres:laksjdf@127.0.0.1/datanommer',

  

      'fmn.url': 'https://apps.fedoraproject.org/notifications',

  
@@ -47,7 +48,8 @@ 

  

      # Run datanommer locally, just for development.

      'datanommer.enabled': True,

-     'datanommer.sqlalchemy.url': 'postgres://postgres:laksjdf@127.0.0.1/datanommer',

+     'datanommer.sqlalchemy.url':

+         'postgres://postgres:laksjdf@127.0.0.1/datanommer',

  

      # Only do one of these so we can try to not run out of memory.

      'moksha.workers_per_consumer': 1,

file modified
+12 -17
@@ -1,20 +1,18 @@ 

  from __future__ import unicode_literals

  

  import datetime

- import json

  import logging

  import os

  

+ import datanommer.models

+ import fedmsg.config

+ import fedmsg.meta

  import flask

  import flask.json

  import munch

- 

  from flask_oidc import OpenIDConnect

  

  import hubs.models

- 

- import datanommer.models

- 

  from hubs.utils import username2avatar

  

  app = flask.Flask(__name__)
@@ -34,15 +32,13 @@ 

  if 'HUBS_CONFIG' in os.environ:

      app.config.from_envvar('HUBS_CONFIG')

  

- import fedmsg.config

- import fedmsg.meta

- 

  fedmsg_config = fedmsg.config.load_config()

  fedmsg.meta.make_processors(**fedmsg_config)

  

  session = hubs.models.init(fedmsg_config['hubs.sqlalchemy.uri'])

  datanommer.models.init(fedmsg_config['datanommer.sqlalchemy.uri'])

  

+ 

  @app.before_request

  def store_db():

      flask.g.db = session
@@ -74,7 +70,7 @@ 

  

  

  # Set up OpenIDConnect

- OIDC = OpenIDConnect(app, credentials_store=flask.session )

+ OIDC = OpenIDConnect(app, credentials_store=flask.session)

  

  

  @app.before_request
@@ -86,17 +82,16 @@ 

          if not hasattr(flask.session, 'auth') or not flask.session.auth:

              flask.session.auth = munch.Munch(

                  fullname=OIDC.user_getfield('name'),

-                 nickname=OIDC.user_getfield('nickname') \

-                     or OIDC.user_getfield('sub'),

+                 nickname=(OIDC.user_getfield('nickname') or

+                           OIDC.user_getfield('sub')),

                  email=OIDC.user_getfield('email'),

                  timezone=OIDC.user_getfield('zoneinfo'),

-                 cla_done=\

-                     'http://admin.fedoraproject.org/accounts/cla/done' \

-                     in OIDC.user_getfield('cla'),

+                 cla_done=('http://admin.fedoraproject.org/accounts/cla/done'

+                           in OIDC.user_getfield('cla')),

                  groups=OIDC.user_getfield('groups'),

                  logged_in=True,

              )

-             flask.session.auth.avatar=username2avatar(

+             flask.session.auth.avatar = username2avatar(

                  flask.session.auth.nickname)

              flask.session.auth.user = hubs.models.User.by_username(

                  flask.session.auth.nickname)
@@ -105,11 +100,11 @@ 

          flask.g.auth = munch.Munch(logged_in=False)

  

  # Register widgets

- import hubs.widgets

+ import hubs.widgets  # noqa

  hubs.widgets.registry.register_list(app.config["WIDGETS"])

  

  # Register routes

- import hubs.views

+ import hubs.views  # noqa

  

  # Add widget-specific routes

  hubs.widgets.registry.register_routes(app)

file modified
+12 -12
@@ -21,28 +21,27 @@ 

  

  from __future__ import unicode_literals

  

- import hubs.app

- import hubs.models

- 

- import hubs.widgets.base

+ import json

+ import logging

+ import logging.config

+ import random

+ import sys

  

  import fedmsg.config

  import fedmsg.meta

- config = fedmsg.config.load_config()

- 

  import retask.queue

  

- import json

- import random

- import sys

- import logging

- import logging.config

+ import hubs.app

+ import hubs.models

+ import hubs.widgets.base

+ 

+ 

  log = logging.getLogger('hubs.backend.triage')

+ config = fedmsg.config.load_config()

  

  

  def triage(session, outbound, msg):

      topic = msg['topic']

-     category = topic.split('.')[3]

  

      for suffix in config['hubs.junk_suffixes']:

          if topic.endswith(suffix):
@@ -115,5 +114,6 @@ 

  

      return 0

  

+ 

  if __name__ == '__main__':

      sys.exit(main(sys.argv))

file modified
+12 -12
@@ -26,29 +26,29 @@ 

  

  from __future__ import unicode_literals

  

- import hubs.app

- import hubs.models

- 

- import hubs.widgets.base

+ import json

+ import logging

+ import logging.config

+ import sys

  

  import fedmsg.config

  import fedmsg.meta

- config = fedmsg.config.load_config()

- 

  import retask.queue

  

- import json

- import sys

- import logging

- import logging.config

+ import hubs.app

+ import hubs.models

+ import hubs.widgets.base

+ 

+ 

  log = logging.getLogger('hubs.backend.worker')

+ config = fedmsg.config.load_config()

  

  

  def work(widget_idx, fn_name):

      # Get a real widget, because we update last_refreshed on it.

      widget = hubs.models.Widget.by_idx(widget_idx)

      fn_class = widget.module.get_cached_functions()[fn_name]

-     log.info("! Rebuilding cache for %r:%r" % (widget, cached_fn))

+     log.info("! Rebuilding cache for %r:%r" % (widget, fn_name))

      # Invalidate the cache...

      fn_class(widget).rebuild()

      # TODO -- fire off an EventSource notice that we updated stuff
@@ -88,7 +88,6 @@ 

              task = queue.wait()  # Wait forever...  timeout is optional.

              log.info("Working on %r.  (backlog is %r)" % (task, queue.length))

              item = json.loads(task.data)

-             idx = item['idx']  # A widget ID

              handle(item['idx'], item['fn_name'])

              log.debug("  Done.")

      except KeyboardInterrupt:
@@ -96,5 +95,6 @@ 

  

      return 0

  

+ 

  if __name__ == '__main__':

      sys.exit(main(sys.argv))

file modified
+2 -1
@@ -31,7 +31,8 @@ 

  

  # TODO - instead of 'develop', use the version from pkg_resources to figure out

  #        the right tag to link people to.  AGPL ftw.

- SOURCE_URL = 'https://pagure.io/fedora-hubs/blob/develop/f'  # /hubs/widgets/badges.py'

+ SOURCE_URL = 'https://pagure.io/fedora-hubs/blob/develop/f'

+ # Example of what will be appended: '/hubs/widgets/badges.py'

  

  CHAT_NETWORKS = [

      {

file modified
+3 -3
@@ -20,9 +20,9 @@ 

      # Right Side Widgets

      widget = hubs.models.Widget(

          plugin='contact', index=-2,

-             _config=json.dumps({

-                 'username': username,

-             }))

+         _config=json.dumps({

+             'username': username,

+         }))

      hub.widgets.append(widget)

  

      widget = hubs.models.Widget(

file modified
+8 -7
@@ -1,25 +1,24 @@ 

  from __future__ import absolute_import, unicode_literals

  

- from alembic import context

- from sqlalchemy import create_engine, pool

  from logging.config import fileConfig

  

- 

  import fedmsg.config

- 

- fedmsg_config = fedmsg.config.load_config()

+ from alembic import context

+ from sqlalchemy import create_engine, pool

  

  

  try:

-     import hubs

+     import hubs  # noqa

  except ImportError:

-     import os, sys

+     import os

+     import sys

      if "hubs" not in os.listdir("."):

          raise

      sys.path.append(os.getcwd())

  

  from hubs.models import BASE

  

+ 

  # This is the Alembic Config object, which provides

  # access to the values within the .ini file in use.

  # The config_file_name property may be None when used programatically.
@@ -28,6 +27,7 @@ 

      # This line sets up loggers basically.

      fileConfig(context.config.config_file_name)

  

+ fedmsg_config = fedmsg.config.load_config()

  url = fedmsg_config['hubs.sqlalchemy.uri']

  target_metadata = BASE.metadata

  
@@ -73,6 +73,7 @@ 

          with context.begin_transaction():

              context.run_migrations()

  

+ 

  if context.is_offline_mode():

      run_migrations_offline()

  else:

@@ -35,11 +35,13 @@ 

  

  

  def upgrade():

-     op.create_table('hubs_config',

+     op.create_table(

+         'hubs_config',

          sa.Column('id', sa.Integer(), nullable=False),

          sa.Column('hub_id', sa.String(length=50), nullable=False),

          sa.Column('summary', sa.String(length=128), nullable=True),

-         sa.Column('left_width', sa.Integer(), nullable=False, server_default="8"),

+         sa.Column('left_width', sa.Integer(), nullable=False,

+                   server_default="8"),

          sa.Column('avatar', sa.String(length=256), nullable=True),

          sa.Column('header_img', sa.String(length=256), nullable=True),

          sa.ForeignKeyConstraint(['hub_id'], ['hubs.name'], ),
@@ -59,13 +61,20 @@ 

  

  

  def downgrade():

-     op.add_column('hubs', sa.Column('avatar', sa.VARCHAR(length=256), nullable=True))

-     op.add_column('hubs', sa.Column('summary', sa.VARCHAR(length=128), nullable=True))

-     op.add_column('hubs', sa.Column('header_img', sa.VARCHAR(length=256), nullable=True))

-     op.add_column('hubs', sa.Column('left_width', sa.INTEGER(), server_default="8", nullable=False))

+     op.add_column(

+         'hubs', sa.Column('avatar', sa.VARCHAR(length=256), nullable=True))

+     op.add_column(

+         'hubs', sa.Column('summary', sa.VARCHAR(length=128), nullable=True))

+     op.add_column(

+         'hubs', sa.Column('header_img', sa.VARCHAR(length=256), nullable=True))

+     op.add_column(

+         'hubs', sa.Column('left_width', sa.INTEGER(), server_default="8",

+                           nullable=False))

      connection = op.get_bind()

-     query = "SELECT hub_id, summary, left_width, avatar, header_img FROM hubs_config"

-     hubs_table = sa.sql.table('hubs',

+     query = ("SELECT hub_id, summary, left_width, avatar, header_img "

+              "FROM hubs_config")

+     hubs_table = sa.sql.table(

+         'hubs',

          sa.sql.column('name', sa.String),

          sa.sql.column('summary', sa.String),

          sa.sql.column('left_width', sa.Integer),
@@ -74,7 +83,7 @@ 

      )

      for row in connection.execute(query):

          op.execute(hubs_table.update().where(

-             hubs_table.c.name==op.inline_literal(row["hub_id"])

+             hubs_table.c.name == op.inline_literal(row["hub_id"])

              ).values({

                  "summary": op.inline_literal(row["summary"]),

                  "left_width": op.inline_literal(row["left_width"]),

file modified
+24 -22
@@ -30,7 +30,6 @@ 

  import random

  

  import bleach

- import dogpile

  import sqlalchemy as sa

  

  from alembic import command as alembic_command
@@ -69,7 +68,7 @@ 

  log = logging.getLogger(__name__)

  

  

- placekitten = lambda: "https://placekitten.com/g/320/320"

+ placekitten = "https://placekitten.com/g/320/320"

  

  

  def randomheader():
@@ -122,8 +121,10 @@ 

                          primary_key=True)

      role = sa.Column(sa.Enum(*roles), primary_key=True)

  

-     user = relation("User", backref=backref('associations', cascade="all, delete"))

-     hub = relation("Hub", backref=backref('associations', cascade="all, delete"))

+     user = relation("User", backref=backref(

+         'associations', cascade="all, delete"))

+     hub = relation("Hub", backref=backref(

+         'associations', cascade="all, delete"))

  

      @classmethod

      def get(cls, hub, user, role):
@@ -139,7 +140,8 @@ 

      name = sa.Column(sa.String(50), primary_key=True)

      created_on = sa.Column(sa.DateTime, default=datetime.datetime.utcnow)

      widgets = relation('Widget', cascade='all,delete', backref='hub')

-     config = relation('HubConfig', uselist=False, cascade='all,delete', backref='hub')

+     config = relation('HubConfig', uselist=False, cascade='all,delete',

+                       backref='hub')

      archived = sa.Column(sa.Boolean, default=False)

      user_hub = sa.Column(sa.Boolean, default=False)

      # Timestamps about various kinds of "freshness"
@@ -358,7 +360,6 @@ 

          self._config = json.dumps(config)

  

      def __json__(self):

-         session = object_session(self)

          module = hubs.widgets.registry[self.plugin]

          root_view = module.get_views()["root"](module)

          data = root_view.get_context(self)
@@ -395,7 +396,7 @@ 

      fullname = sa.Column(sa.Text)

      created_on = sa.Column(sa.DateTime, default=datetime.datetime.utcnow)

      saved_notifications = relation('SavedNotification', backref='users',

-                                        lazy='dynamic')

+                                    lazy='dynamic')

  

      def __json__(self):

          return {
@@ -432,10 +433,10 @@ 

          # TODO -- someday make this editable/configurable.

          return sorted(list(set([

              assoc.hub for assoc in self.associations

-             if assoc.role == 'member'

-             or assoc.role == 'subscriber'

-             or assoc.role == 'owner'

-             and assoc.hub.name != self.username

+             if assoc.role == 'member' or

+             assoc.role == 'subscriber' or

+             assoc.role == 'owner' and

+             assoc.hub.name != self.username

          ])), key=operator.attrgetter('name'))

  

      @classmethod
@@ -468,16 +469,16 @@ 

      __tablename__ = 'visit_counter'

      count = sa.Column(sa.Integer, default=0, nullable=False)

  

-     visited_hub = sa.Column(sa.String(50),

-                        sa.ForeignKey('hubs.name'),

-                        primary_key=True)

+     visited_hub = sa.Column(sa.String(50), sa.ForeignKey('hubs.name'),

+                             primary_key=True)

  

-     username = sa.Column(sa.Text,

-                         sa.ForeignKey('users.username'),

-                         primary_key=True)

+     username = sa.Column(sa.Text, sa.ForeignKey('users.username'),

+                          primary_key=True)

  

-     user = relation("User", backref=backref('visit_counters', cascade="all, delete, delete-orphan"))

-     hub = relation("Hub", backref=backref('visit_counters', cascade="all, delete, delete-orphan"))

+     user = relation("User", backref=backref(

+                     'visit_counters', cascade="all, delete, delete-orphan"))

+     hub = relation("Hub", backref=backref(

+                    'visit_counters', cascade="all, delete, delete-orphan"))

  

      @classmethod

      def by_username(cls, username):
@@ -485,7 +486,8 @@ 

  

      @classmethod

      def get_visits_by_username_hub(cls, username, visited_hub):

-         return cls.query.filter_by(username=username, visited_hub=visited_hub).first()

+         return cls.query.filter_by(

+             username=username, visited_hub=visited_hub).first()

  

      @classmethod

      def increment_visits(cls, session, username, visited_hub):
@@ -534,8 +536,8 @@ 

      markup = sa.Column(sa.Text)

      secondary_icon = sa.Column(sa.Text)

  

- 

-     def __init__(self, username=None, markup='', link='', secondary_icon='', dom_id=''):

+     def __init__(self, username=None, markup='', link='', secondary_icon='',

+                  dom_id=''):

          self.user = username

          self.markup = markup

          self.link = link

file modified
+1 -1
@@ -1,8 +1,8 @@ 

  from __future__ import unicode_literals

  

- import json

  import os

  

+ 

  class Stream(object):

      def get_json(self):

          here = os.path.dirname(os.path.abspath(__file__))

@@ -1,7 +1,5 @@ 

  from __future__ import unicode_literals

  

- import flask

- import unittest

  from six.moves.urllib.parse import urlparse

  

  import hubs.tests

@@ -1,7 +1,6 @@ 

  from __future__ import unicode_literals

  

  import json

- from six.moves.urllib.parse import urlparse

  

  import hubs.tests

  import hubs.models

@@ -404,7 +404,8 @@ 

                  "left_width": 8,

                  "avatar": (

                      "https://seccdn.libravatar.org/avatar/9c9f7784935381befc30"

-                     "2fe3c814f9136e7a33953d0318761669b8643f4df55c?s=312&d=retro"

+                     "2fe3c814f9136e7a33953d0318761669b8643f4df55c"

+                     "?s=312&d=retro"

                      ),

                  "chat_channel": None,

                  "chat_domain": None,

@@ -8,15 +8,16 @@ 

  

  from mock import Mock

  from hubs.tests import APPTest

- #import hubs.models

  

  

  class TestingWidget(Widget):

      name = "testing"

  

+ 

  class TestingView(WidgetView):

      name = "root"

  

+ 

  class TestingFunction(CachedFunction):

      pass

  
@@ -40,8 +41,10 @@ 

      def test_validate(self):

          class LocalTestWidget(Widget):

              views = {}

+ 

              def get_views(self):

                  return self.views

+ 

          self.assertRaisesRegexp(

              AttributeError, '.* "name" .*', LocalTestWidget)

          LocalTestWidget.name = "invalid name \xe2\x98\xba"
@@ -109,10 +112,11 @@ 

              {"TestingFunction": TestingFunction}

              )

  

-     def test_list_views(self):

+     def test_list_additional_views(self):

          class TestView1(WidgetView):

              name = "root"

              url_rules = ["/", "/test-1/"]

+ 

          class TestView2(WidgetView):

              name = "test2"

              url_rules = ["/test-2"]
@@ -127,7 +131,9 @@ 

          self.assertIn("testing_root",

                        self.app.application.url_map._rules_by_endpoint)

          self.assertIn("testing_root", self.app.application.view_functions)

-         rules = list(self.app.application.url_map.iter_rules(endpoint="testing_root"))

+         rules = list(

+             self.app.application.url_map.iter_rules(endpoint="testing_root")

+             )

          self.assertEqual(len(rules), 2)

          self.assertEqual(rules[0].rule, "/<hub>/w/testing/<int:idx>/")

          self.assertEqual(rules[1].rule, "/<hub>/w/testing/<int:idx>/test-1/")
@@ -135,6 +141,8 @@ 

          self.assertIn("testing_test2",

                        self.app.application.url_map._rules_by_endpoint)

          self.assertIn("testing_test2", self.app.application.view_functions)

-         rules = list(self.app.application.url_map.iter_rules(endpoint="testing_test2"))

+         rules = list(

+             self.app.application.url_map.iter_rules(endpoint="testing_test2")

+             )

          self.assertEqual(len(rules), 1)

          self.assertEqual(rules[0].rule, "/<hub>/w/testing/<int:idx>/test-2")

@@ -1,13 +1,10 @@ 

  from __future__ import unicode_literals

  

- import six

  import unittest

  

  from hubs.widgets import validators

  

- #from mock import Mock

  from hubs.tests import APPTest

- from hubs.models import User

  

  

  class ValidatorsTest(APPTest):
@@ -30,7 +27,8 @@ 

  

      def test_username(self):

          self.assertEqual(validators.Username.from_string("ralph"), "ralph")

-         self.assertRaises(ValueError, validators.Username.from_string, "nobody")

+         self.assertRaises(

+             ValueError, validators.Username.from_string, "nobody")

  

      @unittest.skip("Not implemented yet")

      def test_github_organization(self):

@@ -1,12 +1,6 @@ 

  from __future__ import unicode_literals

  

  import json

- from datetime import datetime, timedelta

- from os.path import dirname

- import unittest

- 

- import requests

- import vcr

  

  import hubs.models

  from hubs.tests import APPTest
@@ -20,7 +14,8 @@ 

          widget = hubs.models.Widget(

              plugin='library',

              index=51,

-             _config=json.dumps({"urls": "ralph/"})  # we must add a url or itll crash

+             # We must add a url in the config or it'll crash.

+             _config=json.dumps({"urls": "ralph/"})

          )

          hub.widgets.append(widget)

          hubs.app.session.commit()

@@ -2,8 +2,6 @@ 

  

  import json

  

- from nose.tools import assert_dict_equal

- 

  import hubs.tests.test_widgets

  

  

@@ -2,7 +2,6 @@ 

  

  import json

  

- from mock import patch, MagicMock

  import hubs.tests.test_widgets

  

  
@@ -29,7 +28,8 @@ 

      def test_should_invalidate_wrong_user(self):

          widget = self.widget_instance('ralph', self.plugin)

          # msg = self.get_fedmsg('2016-e371c7f6-bc8e-4632-8e33-b9102dc30b5f')

-         msg = {'topic': 'fedbadges.badge.award', 'msg': {'user': {'username': 'not_ralph'}}}

+         msg = {'topic': 'fedbadges.badge.award',

+                'msg': {'user': {'username': 'not_ralph'}}}

          module = hubs.widgets.registry[widget.plugin]

          func = module.get_cached_functions()['GetBadges']

          result = func(widget).should_invalidate(msg)
@@ -38,7 +38,8 @@ 

      def test_should_invalidate_good_match_fedbadges(self):

          widget = self.widget_instance('ralph', self.plugin)

          # msg = self.get_fedmsg('2016-1fbb1135-681b-4d3b-9a40-d0f6ebd313f4')

-         msg = {'topic': 'fedbadges.badge.award', 'msg': {'user': {'username': 'ralph'}}}

+         msg = {'topic': 'fedbadges.badge.award',

+                'msg': {'user': {'username': 'ralph'}}}

          module = hubs.widgets.registry[widget.plugin]

          func = module.get_cached_functions()['GetBadges']

          result = func(widget).should_invalidate(msg)
@@ -47,7 +48,8 @@ 

      def test_should_invalidate_good_match_hubswidget(self):

          widget = self.widget_instance('ralph', self.plugin)

          # msg = self.get_fedmsg('2016-1fbb1135-681b-4d3b-9a40-d0f6ebd313f4')

-         msg = {'topic': 'hubs.widget.update', 'msg': {'widget': {'id': widget.idx + 1}}}

+         msg = {'topic': 'hubs.widget.update',

+                'msg': {'widget': {'id': widget.idx + 1}}}

          module = hubs.widgets.registry[widget.plugin]

          func = module.get_cached_functions()['GetBadges']

          result = func(widget).should_invalidate(msg)

@@ -5,6 +5,7 @@ 

  import hubs.tests.test_widgets

  import hubs.models

  

+ 

  class TestLibrary(hubs.tests.test_widgets.WidgetTest):

      plugin = 'library'  # The name in hubs.widgets.registry

  

file modified
-2
@@ -1,13 +1,11 @@ 

  from __future__ import unicode_literals

  

- import json

  import logging

  from hashlib import sha256

  

  import arrow

  import markdown

  import requests

- import six

  

  from six.moves.urllib_parse import urlencode

  

file modified
+2
@@ -1,5 +1,7 @@ 

  from __future__ import absolute_import

  

+ # flake8:noqa

+ 

  from .root import *

  from .hub import *

  from .widget import *

file modified
-1
@@ -75,4 +75,3 @@ 

          return flask.abort(400)

      flask.g.db.commit()

      return flask.redirect(flask.url_for('hub', name=hub.name))

- 

file modified
+1 -1
@@ -4,7 +4,7 @@ 

  import flask

  import hubs.models

  

- from hubs.app import app, session

+ from hubs.app import app

  from .utils import get_hub, login_required, RequestValidator

  

  

file modified
+3 -2
@@ -3,7 +3,7 @@ 

  import flask

  import hubs.models

  

- from hubs.app import app, session, OIDC

+ from hubs.app import app, OIDC

  from .utils import authenticated, is_safe_url

  

  
@@ -49,7 +49,8 @@ 

          return_point = default

  

      hubs.models.User.get_or_create(

-         flask.g.db, username=flask.g.auth.nickname, fullname=flask.g.auth.fullname)

+         flask.g.db, username=flask.g.auth.nickname,

+         fullname=flask.g.auth.fullname)

      flask.flash('Login successful', 'success')

  

      return flask.redirect(return_point)

file modified
+8 -5
@@ -5,7 +5,7 @@ 

  import hubs.models

  import hubs.stream

  

- from hubs.app import app, session

+ from hubs.app import app

  from .utils import login_required, get_hub

  

  
@@ -62,16 +62,20 @@ 

              dict(notification=notification.__json__(), success=True)

          )

  

+ 

  @app.route('/<user>/notifications/<int:idx>', methods=['DELETE'])

  @app.route('/<user>/notifications/<int:idx>/', methods=['DELETE'])

  @login_required

  def delete_notifications(user, idx):

-     notification = flask.g.db.query(hubs.models.SavedNotification).filter_by(idx=idx).first()

+     notification = flask.g.db.query(

+         hubs.models.SavedNotification).filter_by(idx=idx).first()

      if not notification:

          return flask.abort(400)

      flask.g.db.delete(notification)

      flask.g.db.commit()

      return flask.jsonify(dict(status_code=200))

+ 

+ 

  @app.route('/visit/<visited_hub>/', methods=['GET', 'POST'])

  @app.route('/visit/<visited_hub>', methods=['GET', 'POST'])

  @login_required
@@ -80,9 +84,8 @@ 

  

      if str(visited_hub) != str(nickname):

          try:

-             vc = hubs.models.VisitCounter.get_or_create(session=flask.g.db,

-                                                         username=nickname,

-                                                         visited_hub=visited_hub)

+             vc = hubs.models.VisitCounter.get_or_create(

+                 session=flask.g.db, username=nickname, visited_hub=visited_hub)

          except ValueError:  # this should never trip

              # flask will 405 if visited_hub is blank

              # @login_required forces flask.g.auth to be sets

file modified
+1
@@ -28,6 +28,7 @@ 

      cache.configure(**config.get('fedora-hubs.cache', cache_defaults))

      return cache

  

+ 

  cache = _get_cache()

  

  

@@ -69,7 +69,7 @@ 

                  for repo in repos

              ], [])

              # Reverse-sort by time (newest-first)

-             pulls.sort(lambda a, b: cmp(b['timestamp'], a['timestamp']))

+             pulls.sort(key=lambda x: x['timestamp'], reverse=True)

  

              # Some hints for display

              len_pulls = len(pulls)

file modified
+1 -2
@@ -122,8 +122,7 @@ 

      @classmethod

      def from_string(cls, value):

          # TODO get this from the fedmsg config.

-         if value in [

-             'irc', 'email', 'android', 'desktop', 'hubs',]:

+         if value in ['irc', 'email', 'android', 'desktop', 'hubs']:

              return value

          raise ValueError('Invalid FMN context')

  

file modified
+4 -4
@@ -1,7 +1,7 @@ 

  #!/usr/bin/env python

  """ Populate the hubs db with lots of data from FAS. """

  

- from __future__ import unicode_literals

+ from __future__ import unicode_literals, print_function

  

  import getpass

  import socket
@@ -14,7 +14,7 @@ 

  fedmsg_config = fedmsg.config.load_config()

  

  fasclient = fedora.client.fas2.AccountSystem(

-     username=raw_input('Your FAS username: '),

+     username=input('Your FAS username: '),

      password=getpass.getpass(),

  )

  timeout = socket.getdefaulttimeout()
@@ -39,7 +39,7 @@ 

  for letter in reversed(sorted(list(set(string.letters.lower())))):

      session = hubs.models.init(

          fedmsg_config['hubs.sqlalchemy.uri'], True, True)

-     print "Querying FAS for the %r users.. hang on." % letter

+     print("Querying FAS for the %r users.. hang on." % letter)

      request = fasclient.send_request(

          '/user/list',

          req_params={'search': '%s*' % letter, 'status': 'active'},
@@ -50,7 +50,7 @@ 

      for user in users:

          username = user['username']

          fullname = user['human_name']

-         print "Creating account for %r" % username

+         print("Creating account for %r" % username)

          hubs_user = hubs.models.User.get_or_create(

              session, username=username, fullname=fullname)

  

file modified
+132 -90
@@ -35,7 +35,7 @@ 

  

  session.commit()

  

- ############## Internationalizationteam

+ # ############# Internationalizationteam

  hub = hubs.models.Hub(name='i18n', archived=True)

  session.add(hub)

  session.add(hubs.models.HubConfig(
@@ -45,13 +45,14 @@ 

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='stats', index=0)

  hub.widgets.append(widget)

- widget = hubs.models.Widget(plugin='rules', index=1,

-                             _config=json.dumps({

-                                 'link': 'https://fedoraproject.org/wiki/I18N',

-                                 'schedule_text': None,

-                                 'schedule_link': None,

-                                 'minutes_link': 'https://meetbot.fedoraproject.org/sresults/?group_id=i18n&type=team',

-                             }))

+ widget = hubs.models.Widget(

+     plugin='rules', index=1, _config=json.dumps({

+         'link': 'https://fedoraproject.org/wiki/I18N',

+         'schedule_text': None,

+         'schedule_link': None,

+         'minutes_link': 'https://meetbot.fedoraproject.org/sresults/'

+                         '?group_id=i18n&type=team',

+     }))

  hub.widgets.append(widget)

  

  widget = hubs.models.Widget(plugin='meetings', index=2,
@@ -59,16 +60,25 @@ 

  hub.widgets.append(widget)

  

  # Added a hubs about widget

- widget = hubs.models.Widget(plugin='about', index=3,

-                             _config=json.dumps({

-                                 "text": "I'm a Fedora user, and this is my about widget text!",

-                             }))

- hub.widgets.append(widget)

- 

- widget = hubs.models.Widget(plugin='sticky', index=1, left=True,

-                             _config=json.dumps({

-                                 'text': "<p>The Fedora I18N project works on internationalization (i18n) to support the localization (l10n) of Fedora in many languages. Translation of Fedora software and documentation are handled by the Fedora L10N project.</p> <p>The goals of the Project are to:</p> <ul><li>Develop, package, and maintain applications like input methods for different languages</li> <li>Improve applications and utilities to support and process different languages</li> <li>Quality-assure that existing applications meet i18n standards</li> <li>Support the infrastructure of the Fedora Localization Project</li></ul>",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='about', index=3, _config=json.dumps({

+         "text": "I'm a Fedora user, and this is my about widget text!",

+     }))

+ hub.widgets.append(widget)

+ 

+ widget = hubs.models.Widget(

+     plugin='sticky', index=1, left=True, _config=json.dumps({

+         'text': """

+ <p>The Fedora I18N project works on internationalization (i18n) to support the

+ localization (l10n) of Fedora in many languages. Translation of Fedora software

+ and documentation are handled by the Fedora L10N project.</p> <p>The goals of

+ the Project are to:</p> <ul><li>Develop, package, and maintain applications

+ like input methods for different languages</li> <li>Improve applications and

+ utilities to support and process different languages</li> <li>Quality-assure

+ that existing applications meet i18n standards</li> <li>Support the

+ infrastructure of the Fedora Localization Project</li></ul>

+ """,

+     }))

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='dummy', index=2, left=True)

  hub.widgets.append(widget)
@@ -82,7 +92,7 @@ 

  

  session.commit()

  

- ############## CommOps

+ # ############# CommOps

  hub = hubs.models.Hub(name='commops')

  session.add(hub)

  session.add(hubs.models.HubConfig(
@@ -92,17 +102,20 @@ 

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='stats', index=0)

  hub.widgets.append(widget)

- widget = hubs.models.Widget(plugin='rules', index=1,

-                             _config=json.dumps({

-                                 'link': 'https://fedoraproject.org/wiki/CommOps',

-                                 'schedule_text': None,

-                                 'schedule_link': None,

-                                 'minutes_link': 'http://meetbot.fedoraproject.org/sresults/?group_id=commops&type=team',

-                             }))

+ widget = hubs.models.Widget(

+     plugin='rules', index=1, _config=json.dumps({

+         'link': 'https://fedoraproject.org/wiki/CommOps',

+         'schedule_text': None,

+         'schedule_link': None,

+         'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

+                         '?group_id=commops&type=team',

+     }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='meetings', index=2,

-                             _config=json.dumps({'calendar': 'commops', 'n_meetings': 4}))

+ widget = hubs.models.Widget(

+     plugin='meetings', index=2, _config=json.dumps({

+         'calendar': 'commops', 'n_meetings': 4

+     }))

  hub.widgets.append(widget)

  

  # Added a hubs about widget
@@ -112,10 +125,12 @@ 

                              }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='sticky', index=1, left=True,

-                             _config=json.dumps({

-                                 'text': "Bringing more heat and light to Fedora, so you don't have to choose between 'building things' and 'building communities that build things.'",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='sticky', index=1, left=True, _config=json.dumps({

+         'text': "Bringing more heat and light to Fedora, so you don't have "

+                 "to choose between 'building things' and 'building "

+                 "communities that build things.'",

+     }))

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='dummy', index=2, left=True)

  hub.widgets.append(widget)
@@ -131,7 +146,7 @@ 

  

  session.commit()

  

- ############## Marketing team

+ # ############# Marketing team

  hub = hubs.models.Hub(name='marketing')

  session.add(hub)

  session.add(hubs.models.HubConfig(
@@ -141,30 +156,41 @@ 

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='stats', index=0)

  hub.widgets.append(widget)

- widget = hubs.models.Widget(plugin='rules', index=1,

-                             _config=json.dumps({

-                                 'link': 'https://fedoraproject.org/wiki/Marketing',

-                                 'schedule_text': None,

-                                 'schedule_link': None,

-                                 'minutes_link': 'http://meetbot.fedoraproject.org/sresults/?group_id=fedora-mktg&type=channel',

-                             }))

+ widget = hubs.models.Widget(

+     plugin='rules', index=1, _config=json.dumps({

+         'link': 'https://fedoraproject.org/wiki/Marketing',

+         'schedule_text': None,

+         'schedule_link': None,

+         'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

+                         '?group_id=fedora-mktg&type=channel',

+     }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='meetings', index=2,

-                             _config=json.dumps({'calendar': 'marketing', 'n_meetings': 4}))

+ widget = hubs.models.Widget(

+     plugin='meetings', index=2, _config=json.dumps({

+         'calendar': 'marketing', 'n_meetings': 4

+     }))

  hub.widgets.append(widget)

  

  # Added a hubs about widget

- widget = hubs.models.Widget(plugin='about', index=3,

-                             _config=json.dumps({

-                                 "text": "I'm a Fedora user, and this is my about widget text!",

-                             }))

- hub.widgets.append(widget)

- 

- widget = hubs.models.Widget(plugin='sticky', index=1, left=True,

-                             _config=json.dumps({

-                                 'text': "The Fedora Marketing Team develops and executes marketing strategies to promote the usage and support of Fedora worldwide. Through the development of processes and content, this project aims to support the efforts of other Fedora projects to spread Fedora and to provide a central repository of ideas and information that can be used to deliver Fedora to new audiences. We work closely with the Fedora Ambassadors who spread the word about Fedora at events and allow the Fedora Project to interact directly with its existing and prospective users. ",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='about', index=3, _config=json.dumps({

+         "text": "I'm a Fedora user, and this is my about widget text!",

+     }))

+ hub.widgets.append(widget)

+ 

+ widget = hubs.models.Widget(

+     plugin='sticky', index=1, left=True, _config=json.dumps({

+         'text': """

+ The Fedora Marketing Team develops and executes marketing strategies to promote

+ the usage and support of Fedora worldwide. Through the development of processes

+ and content, this project aims to support the efforts of other Fedora projects

+ to spread Fedora and to provide a central repository of ideas and information

+ that can be used to deliver Fedora to new audiences. We work closely with the

+ Fedora Ambassadors who spread the word about Fedora at events and allow the

+ Fedora Project to interact directly with its existing and prospective users.

+ """,

+     }))

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='dummy', index=2, left=True)

  hub.widgets.append(widget)
@@ -181,7 +207,7 @@ 

  

  session.commit()

  

- ############## Design team

+ # ############# Design team

  hub = hubs.models.Hub(name='designteam')

  session.add(hub)

  session.add(hubs.models.HubConfig(
@@ -191,30 +217,37 @@ 

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='stats', index=0)

  hub.widgets.append(widget)

- widget = hubs.models.Widget(plugin='rules', index=1,

-                             _config=json.dumps({

-                                 'link': 'https://fedoraproject.org/wiki/Design',

-                                 'schedule_text': 'Meetings are every other Tuesday at 16:00 UTC',

-                                 'schedule_link': 'https://apps.fedoraproject.org/calendar/design/',

-                                 'minutes_link': 'http://meetbot.fedoraproject.org/sresults/?group_id=fedora-design&type=channel',

-                             }))

+ widget = hubs.models.Widget(

+     plugin='rules', index=1, _config=json.dumps({

+         'link': 'https://fedoraproject.org/wiki/Design',

+         'schedule_text': 'Meetings are every other Tuesday at 16:00 UTC',

+         'schedule_link': 'https://apps.fedoraproject.org/calendar/design/',

+         'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

+                         '?group_id=fedora-design&type=channel',

+     }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='meetings', index=2,

-                             _config=json.dumps({'calendar': 'design', 'n_meetings': 4}))

+ widget = hubs.models.Widget(

+     plugin='meetings', index=2, _config=json.dumps({

+         'calendar': 'design', 'n_meetings': 4

+     }))

  hub.widgets.append(widget)

  

  # Added a hubs about widget

- widget = hubs.models.Widget(plugin='about', index=3,

-                             _config=json.dumps({

-                                 "text": "I'm a Fedora user, and this is my about widget text!",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='about', index=3, _config=json.dumps({

+         "text": "I'm a Fedora user, and this is my about widget text!",

+     }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='sticky', index=1, left=True,

-                             _config=json.dumps({

-                                 'text': "The Design Team is the design group of the Fedora project. Our interests are not only in creating graphics for use by the Fedora community, but also in advocating the use of the creative tools that are a part of Fedora.",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='sticky', index=1, left=True, _config=json.dumps({

+         'text': """

+ The Design Team is the design group of the Fedora project. Our interests are

+ not only in creating graphics for use by the Fedora community, but also in

+ advocating the use of the creative tools that are a part of Fedora.

+ """,

+     }))

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='dummy', index=2, left=True)

  hub.widgets.append(widget)
@@ -232,7 +265,7 @@ 

  session.commit()

  

  

- ############## Infra team

+ # ############# Infra team

  hub = hubs.models.Hub(name='infrastructure')

  session.add(hub)

  session.add(hubs.models.HubConfig(
@@ -242,30 +275,39 @@ 

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='stats', index=0)

  hub.widgets.append(widget)

- widget = hubs.models.Widget(plugin='rules', index=1,

-                             _config=json.dumps({

-                                 'link': 'https://fedoraproject.org/wiki/Infrastructure',

-                                 'schedule_text': 'We meet weekly in #fedora-meeting at 18:00 UTC',

-                                 'schedule_link': 'https://apps.fedoraproject.org/calendar/infrastructure/',

-                                 'minutes_link': 'http://meetbot.fedoraproject.org/sresults/?group_id=infrastructure&type=team',

-                             }))

+ widget = hubs.models.Widget(

+     plugin='rules', index=1, _config=json.dumps({

+         'link': 'https://fedoraproject.org/wiki/Infrastructure',

+         'schedule_text': 'We meet weekly in #fedora-meeting at 18:00 UTC',

+         'schedule_link':

+             'https://apps.fedoraproject.org/calendar/infrastructure/',

+         'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

+                         '?group_id=infrastructure&type=team',

+     }))

  hub.widgets.append(widget)

  

- widget = hubs.models.Widget(plugin='meetings', index=2,

-                             _config=json.dumps({'calendar': 'infrastructure', 'n_meetings': 4}))

+ widget = hubs.models.Widget(

+     plugin='meetings', index=2, _config=json.dumps({

+         'calendar': 'infrastructure', 'n_meetings': 4

+     }))

  hub.widgets.append(widget)

  

  # Added a hubs about widget

- widget = hubs.models.Widget(plugin='about', index=3,

-                             _config=json.dumps({

-                                 "text": "I'm a Fedora user, and this is my about widget text!",

-                             }))

- hub.widgets.append(widget)

- 

- widget = hubs.models.Widget(plugin='sticky', index=2, left=True,

-                             _config=json.dumps({

-                                 'text': "The Infrastructure Team consists of dedicated volunteers and professionals managing the servers, building the tools and utilities, and creating new applications to make Fedora development a smoother process. We're located all over the globe and communicate primarily by IRC and e-mail. ",

-                             }))

+ widget = hubs.models.Widget(

+     plugin='about', index=3, _config=json.dumps({

+         "text": "I'm a Fedora user, and this is my about widget text!",

+     }))

+ hub.widgets.append(widget)

+ 

+ widget = hubs.models.Widget(

+     plugin='sticky', index=2, left=True, _config=json.dumps({

+         'text': """

+ The Infrastructure Team consists of dedicated volunteers and professionals

+ managing the servers, building the tools and utilities, and creating new

+ applications to make Fedora development a smoother process. We're located all

+ over the globe and communicate primarily by IRC and e-mail.

+ """,

+     }))

  hub.widgets.append(widget)

  widget = hubs.models.Widget(plugin='dummy', index=3, left=True)

  hub.widgets.append(widget)

file modified
+1 -2
@@ -3,7 +3,6 @@ 

  from __future__ import unicode_literals

  

  import argparse

- import sys

  import os

  

  parser = argparse.ArgumentParser(
@@ -32,7 +31,7 @@ 

      os.environ['HUBS_CONFIG'] = config

  

  

- from hubs.app import app

+ from hubs.app import app  # noqa

  

  app.debug = True

  app.run(debug=True, host=args.host, port=int(args.port))

file modified
+3 -3
@@ -26,8 +26,8 @@ 

      download_url="https://pypi.python.org/pypi/fedora-hubs/",

      license='AGPLv3+',

      install_requires=get_requirements(),

-     #tests_require=tests_require,

-     #test_suite='nose.collector',

+     # tests_require=tests_require,

+     # test_suite='nose.collector',

      packages=find_packages(),

      include_package_data=True,

      zip_safe=False,
@@ -40,7 +40,7 @@ 

      ],

      entry_points={

          'moksha.consumer': [

-             "cache_invalidator = hubs.backend.consumer:CacheInvalidatorExtraordinaire",

+             "cache_invalidator = hubs.backend.consumer:CacheInvalidatorExtraordinaire",  # noqa

          ],

      },

  )

file modified
+2 -4
@@ -11,9 +11,7 @@ 

  from __future__ import print_function, unicode_literals

  

  import argparse

- import os

  

- import dogpile.cache

  import fedmsg.config

  import fedmsg.meta

  
@@ -39,8 +37,8 @@ 

          widget = w_instance.module

          for fn_name, fn_class in widget.get_cached_functions().items():

              if fn_class(w_instance).is_cached():

-                 print('- Widget cached {0} (#{1}) in {2}'.format(

-                           w_instance.hub_id, w_instance.idx, w_instance.plugin))

+                 print(('- Widget cached {inst.hub_id} (#{inst.idx}) '

+                        'in {inst.plugin}').format(inst=w_instance))

  

  

  def do_clean(args):

file modified
+1 -1
@@ -1,5 +1,5 @@ 

  [tox]

- envlist = py{27,34,35},js,docs

+ envlist = py{27,34,35},js,docs,lint

  skipsdist = True

  

  

This commit fixes all Flake8 errors and enables the "lint" test in tox (that just runs flake8).

It should be mostly harmless (whitespaces and unused imports), no code change except some imports reorders, but I've checked them and they should not cause problems.
All unit tests still pass, the app seems to run properly.

Pull-Request has been merged by abompard

7 years ago
Metadata
Changes Summary 39
+0 -1
file changed
check-cache-coverage.py
+4 -4
file changed
check-queue-length.py
+9 -10
file changed
delete-user.py
+2 -2
file changed
docs/conf.py
+4 -6
file changed
fedmsg.d/base.py
+4 -2
file changed
fedmsg.d/testconfig.py
+12 -17
file changed
hubs/app.py
+12 -12
file changed
hubs/backend/triage.py
+12 -12
file changed
hubs/backend/worker.py
+2 -1
file changed
hubs/default_config.py
+3 -3
file changed
hubs/defaults.py
+8 -7
file changed
hubs/migrations/env.py
+18 -9
file changed
hubs/migrations/versions/1d660b32b83a_hub_config.py
+24 -22
file changed
hubs/models.py
+1 -1
file changed
hubs/stream.py
+0 -2
file changed
hubs/tests/test_api/test_hub.py
+0 -1
file changed
hubs/tests/test_api/test_notifications.py
+2 -1
file changed
hubs/tests/test_fedora_hubs_flask_api.py
+12 -4
file changed
hubs/tests/test_widget_base.py
+2 -4
file changed
hubs/tests/test_widget_validators.py
+2 -7
file changed
hubs/tests/test_widgets/__init__.py
+0 -2
file changed
hubs/tests/test_widgets/test_about.py
+6 -4
file changed
hubs/tests/test_widgets/test_badges.py
+1 -0
file changed
hubs/tests/test_widgets/test_library.py
+0 -2
file changed
hubs/utils.py
+2 -0
file changed
hubs/views/__init__.py
+0 -1
file changed
hubs/views/api.py
+1 -1
file changed
hubs/views/hub.py
+3 -2
file changed
hubs/views/root.py
+8 -5
file changed
hubs/views/user.py
+1 -0
file changed
hubs/widgets/caching.py
+1 -1
file changed
hubs/widgets/github_pr/__init__.py
+1 -2
file changed
hubs/widgets/validators.py
+4 -4
file changed
populate-from-fas.py
+132 -90
file changed
populate.py
+1 -2
file changed
runserver.py
+3 -3
file changed
setup.py
+2 -4
file changed
smart_cache_invalidator.py
+1 -1
file changed
tox.ini