trivial: apply black

This commit is contained in:
Frédéric Péters 2021-01-13 17:44:03 +01:00
parent b2faf62476
commit ce00ecca22
4 changed files with 62 additions and 38 deletions

View File

@ -145,7 +145,7 @@ def postgresql(ctn):
return -1
sorted_backup_files = sorted(backup_files, key=os.path.getmtime)
created = os.stat(sorted_backup_files[-1]).st_ctime
return((datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).total_seconds())
return (datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).total_seconds()
recovery = glob.glob("/var/lib/postgresql/*/*/recovery.conf")
if len(recovery) == 0:
@ -195,8 +195,10 @@ def units(ctn):
def run_in_machines(ctn):
for machine in login.machine_names():
r = run("systemd-run --wait --pipe -q --machine %s /usr/bin/prometheus-entrouvert-exporter.py --ctn %s"
% (machine, machine))
r = run(
"systemd-run --wait --pipe -q --machine %s /usr/bin/prometheus-entrouvert-exporter.py --ctn %s"
% (machine, machine)
)
current_metrics = text_string_to_metric_families(r)
for m in current_metrics:
for s in m.samples:
@ -210,8 +212,24 @@ if __name__ == "__main__":
parser.add_argument("--ctn", default="")
args = parser.parse_args()
for test in [certificates, debian, etckeeper, exim, journald, local_changes, mailboxes, munin,
nginx, packages, postgresql, rabbitmq, sessions, threads, units, run_in_machines]:
for test in [
certificates,
debian,
etckeeper,
exim,
journald,
local_changes,
mailboxes,
munin,
nginx,
packages,
postgresql,
rabbitmq,
sessions,
threads,
units,
run_in_machines,
]:
try:
test(args.ctn)
except Exception:

View File

@ -35,7 +35,7 @@ extensions = []
templates_path = ['_templates']
source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
'.md': 'recommonmark.parser.CommonMarkParser',
}
# The suffix(es) of source filenames.
@ -128,12 +128,9 @@ html_theme = 'alabaster'
html_sidebars = {'**': ['navigation.html', 'searchbox.html']}
html_theme_options = {
'extra_nav_links': {
"Guide de déploiement":
"https://doc.entrouvert.org/publik-infra/",
"Guide de l'administrateur technique":
"https://doc-publik.entrouvert.com/tech/",
"☜ Accueil":
"https://doc-publik.entrouvert.com/",
"Guide de déploiement": "https://doc.entrouvert.org/publik-infra/",
"Guide de l'administrateur technique": "https://doc-publik.entrouvert.com/tech/",
"☜ Accueil": "https://doc-publik.entrouvert.com/",
}
}
@ -254,29 +251,31 @@ htmlhelp_basename = 'InfrastructuredePublikdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'InfrastructuredePublik.tex', u'Infrastructure de Publik Documentation',
u'Entrouvert', 'manual'),
(
master_doc,
'InfrastructuredePublik.tex',
u'Infrastructure de Publik Documentation',
u'Entrouvert',
'manual',
),
]
# The name of an image file (relative to this directory) to place at the top of
@ -316,10 +315,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'infrastructuredepublik', u'Infrastructure de Publik Documentation',
[author], 1)
]
man_pages = [(master_doc, 'infrastructuredepublik', u'Infrastructure de Publik Documentation', [author], 1)]
# If true, show URL addresses after external links.
#
@ -332,9 +328,15 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'InfrastructuredePublik', u'Infrastructure de Publik Documentation',
author, 'InfrastructuredePublik', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
'InfrastructuredePublik',
u'Infrastructure de Publik Documentation',
author,
'InfrastructuredePublik',
'One line description of project.',
'Miscellaneous',
),
]
# Documents to append as an appendix to all manuals.

View File

@ -9,10 +9,11 @@ Code, link URLs, etc. are not affected.
from pandocfilters import toJSONFilter, Str
def despan(key, value, format, meta):
if key == 'Span':
return []
if __name__ == "__main__":
toJSONFilter(despan)
toJSONFilter(despan)

View File

@ -1,14 +1,17 @@
from panflute import *
def increase_header_level(elem, doc):
if type(elem) == Header:
if elem.level < 6:
elem.level += 1
else:
return [] # Delete headers already in level 6
return [] # Delete headers already in level 6
def main(doc=None):
return run_filter(increase_header_level, doc=doc)
if __name__ == "__main__":
main()