From 2d9a57a8729e8f573dc9a35e662c543bf0d53c8d Mon Sep 17 00:00:00 2001 From: Marek Chrastina <marek.chrastina@vsb.cz> Date: Thu, 7 May 2020 09:56:46 +0200 Subject: [PATCH] Fix python environment --- .gitlab-ci.yml | 2 ++ mkdocs.yml | 1 + scripts/combinations.py | 6 ++++-- scripts/matrix.py | 16 +++++++++------- scripts/modules_matrix.py | 3 +-- scripts/titlemd.py | 10 ++++------ 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b44785cd..32fc2d207 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,8 @@ docs: pylint: stage: test image: it4innovations/docker-pycheck:latest + before_script: + - source /opt/.venv3/bin/activate script: - pylint $(find . -name "*.py" -not -name "feslicescript.py") diff --git a/mkdocs.yml b/mkdocs.yml index 524d5662e..bc2c45639 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -240,6 +240,7 @@ markdown_extensions: - pymdownx.snippets: base_path: snippets - pymdownx.tabbed: + - pymdownx.superfences google_analytics: - 'UA-90498826-1' diff --git a/scripts/combinations.py b/scripts/combinations.py index 67cf39b0d..5982443b9 100644 --- a/scripts/combinations.py +++ b/scripts/combinations.py @@ -2,6 +2,8 @@ # -*- coding: utf-8 -*- """ combinations """ +from __future__ import print_function + import itertools import re @@ -9,5 +11,5 @@ CHARS = ['A', 'S', 'U', 'T', 'D'] MASK = ''.join(reversed(CHARS)) for i in range(1, len(CHARS)+1): for comb in itertools.combinations(CHARS, i): - reg = "[^%s]" % ''.join(comb) - print re.sub(reg, "-", MASK) + REG = "[^%s]" % ''.join(comb) + print(re.sub(REG, "-", MASK)) diff --git a/scripts/matrix.py b/scripts/matrix.py index a285cabbd..4f2c25060 100644 --- a/scripts/matrix.py +++ b/scripts/matrix.py @@ -2,16 +2,18 @@ # -*- coding: utf-8 -*- """ matrix """ +from __future__ import print_function + import itertools CHARS = ['A', 'S', 'U', 'P', 'D', 'B'] MASK = ''.join(reversed(CHARS)) for bits in itertools.product([0, 1], repeat=len(CHARS)): - s = "".join(str(bit) for bit in bits) - ns = "" - for i, _ in enumerate(s): - if s[i] == "1": - ns += MASK[i] + SBIT = "".join(str(bit) for bit in bits) + NST = "" + for i, _ in enumerate(SBIT): + if SBIT[i] == "1": + NST += MASK[i] else: - ns += "-" - print ns + NST += "-" + print(NST) diff --git a/scripts/modules_matrix.py b/scripts/modules_matrix.py index a2e3acb5e..9a8f4a54b 100755 --- a/scripts/modules_matrix.py +++ b/scripts/modules_matrix.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding: utf-8 -*- """ modules_matrix """ @@ -133,7 +133,6 @@ def main(): if arg.json: print(json.dumps(packages_json(software))) else: - print(datalist) print_hint() print_software(software) diff --git a/scripts/titlemd.py b/scripts/titlemd.py index 39fb6b0a0..73520c6b4 100755 --- a/scripts/titlemd.py +++ b/scripts/titlemd.py @@ -39,15 +39,13 @@ def linestart(line, disabled, test, prev_line=None): if test: if (line.startswith("``") or line.startswith("extra:")) and not disabled: return True - else: - if (line.startswith("``") or prev_line.startswith("pages:")) and disabled: - return False + if (line.startswith("``") or prev_line.startswith("pages:")) and disabled: + return False else: if line.startswith("``") and not disabled: return True - else: - if line.startswith("``") and disabled: - return False + if line.startswith("``") and disabled: + return False return disabled def testdata(arg): -- GitLab