Commit 39106e21 authored by Nicola Spanti's avatar Nicola Spanti
Browse files

Add a basic file for GitLab CI (with only `flake8` currently)

As a first step, we only add `flake8`. It is not great, but better
than nothing and can already be published as it is. Further things
can be added later and do not have to block this first step.

--HG--
branch : 3.26
parent cdcc9555871e
Pipeline #31983 passed with stage
in 37 seconds
image: python:3.7
stages:
- lint
lint_py:
only:
changes:
- "**/*.py"
stage: lint
before_script:
- pip install tox
script:
- tox -e flake8
# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# contact https://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
#
......@@ -14,7 +14,7 @@
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
# with CubicWeb. If not, see <https://www.gnu.org/licenses/>.
import sys
import os
from os.path import join
......@@ -53,8 +53,9 @@ class CubicWebCtlTC(unittest.TestCase):
def test_list_configurations(self):
ListCommand(None).run(['configurations'])
configs = [l[2:].strip() for l in self.stream.getvalue().splitlines()
if l.startswith('* ')]
configs = [line[2:].strip()
for line in self.stream.getvalue().splitlines()
if line.startswith('* ')]
self.assertIn('all-in-one', configs)
self.assertIn('pyramid', configs)
......
# copyright 2003 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# contact https://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
#
......@@ -14,7 +14,7 @@
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
# with CubicWeb. If not, see <https://www.gnu.org/licenses/>.
"""
.. autoclass:: AutomaticEntityForm
......@@ -733,10 +733,13 @@ class UnrelatedDivs(EntityView):
mode = '%s:%s:%s:%s' % (role, entity.eid, rschema.type, eschema)
url = self._cw.build_url(entity.rest_path(), vid='search-associate',
__mode=mode)
options.append((eschema.display_name(self._cw),
'<option value="%s">%s %s</option>' % (
xml_escape(url), _('Search for'), eschema.display_name(self._cw))))
return [o for l, o in sorted(options)]
options.append(
(eschema.display_name(self._cw),
'<option value="%s">%s %s</option>' % (
xml_escape(url),
_('Search for'),
eschema.display_name(self._cw))))
return [option for name, option in sorted(options)]
# The automatic entity form ####################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment