Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bookworm' into new-log-streaming…
Browse files Browse the repository at this point in the history
…-api
  • Loading branch information
alexAubin committed Jul 17, 2024
2 parents 47a6006 + bb0a9bd commit ed6ad7b
Show file tree
Hide file tree
Showing 56 changed files with 358 additions and 288 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/autoblack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ jobs:
name: Check / auto apply black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check files using the black formatter
uses: rickstaa/action-black@v1
id: action_black
uses: psf/black@stable
id: black
with:
black_args: "."
options: "."
continue-on-error: true
- shell: pwsh
id: check_files_changed
run: |
# Diff HEAD with the previous commit
$diff = git diff
$HasDiff = $diff.Length -gt 0
Write-Host "::set-output name=files_changed::$HasDiff"
- name: Create Pull Request
if: steps.action_black.outputs.is_formatted == 'true'
uses: peter-evans/create-pull-request@v3
if: steps.check_files_changed.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Format Python code with Black"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Autoreformat locale files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Apply reformating scripts
id: action_reformat
run: |
Expand All @@ -18,7 +18,7 @@ jobs:
git diff -w --exit-code
- name: Create Pull Request
if: ${{ failure() }}
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Reformat locale files"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.11]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install apt dependencies
Expand All @@ -26,24 +26,24 @@ jobs:
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e py39-pytest
run: tox -e py311-pytest

invalidcode:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.11]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Linter
run: tox -e py39-invalidcode
run: tox -e py311-invalidcode
- name: Mypy
run: tox -e py39-mypy
run: tox -e py311-mypy
27 changes: 27 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ moulinette (12.0.0) unstable; urgency=low

-- Alexandre Aubin <[email protected]> Thu, 04 May 2023 20:30:19 +0200

moulinette (11.2.1) stable; urgency=low

- repo chores: various black enhancements
- [i18n] Translations updated for Arabic, Basque, Catalan, Chinese (Simplified), Czech, Dutch, English, Esperanto, French, Galician, German, Hindi, Indonesian, Italian, Japanese, Nepali, Norwegian Bokmål, Persian, Polish, Portuguese, Russian, Spanish, Swedish, Turkish, Ukrainian

Thanks to all contributors <3 ! (Alexandre Aubin, Francescc, José M, Metin Bektas, ppr, Psycojoker, rosbeef andino, Tagada, xabirequejo, xaloc33)

-- OniriCorpe <[email protected]> Sun, 19 May 2024 23:49:00 +0200

moulinette (11.2) stable; urgency=low

- [i18n] Translations updated for Japanese

Thanks to all contributors <3 ! (motcha)

-- Alexandre Aubin <[email protected]> Mon, 17 Jul 2023 16:32:34 +0200

moulinette (11.1.5) stable; urgency=low

- setup.py: fix version specifier in python_requires, python tooling not happy with * i guess (2373a7fa)
- auth: prevent stupid issue where outdated cookie usage would trigger error 500 intead of 401, resulting in a ~bug after Yunohost self-upgrade and the webadmin is confused about the API not being up again (c06e1a91)
- i18n: Translations updated for Chinese (Simplified), Indonesian, Japanese

Thanks to all contributors <3 ! (liimee, motcha, Neko Nekowazarashi, Poesty Li)

-- Alexandre Aubin <[email protected]> Mon, 10 Jul 2023 21:32:20 +0200

moulinette (11.1.4) stable; urgency=low

- Releasing as stable
Expand Down
42 changes: 26 additions & 16 deletions doc/ldif2dot-0.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self):

def __repr__(self):
"""Returns a basic state dump."""
return 'Element' + str(self.index) + str(self.attributes)
return "Element" + str(self.index) + str(self.attributes)

def add(self, line):
"""Adds a line of input to the object.
Expand All @@ -57,10 +57,10 @@ def add(self, line):
"""

def _valid(line):
return line and not line.startswith('#')
return line and not line.startswith("#")

def _interesting(line):
return line != 'objectClass: top'
return line != "objectClass: top"

if self.is_valid() and not _valid(line):
return True
Expand All @@ -70,11 +70,11 @@ def _interesting(line):

def is_valid(self):
"""Indicates whether a valid entry has been read."""
return len(self.attributes) != 0 and self.attributes[0].startswith('dn: ')
return len(self.attributes) != 0 and self.attributes[0].startswith("dn: ")

def dn(self):
"""Returns the DN for this entry."""
if self.attributes[0].startswith('dn: '):
if self.attributes[0].startswith("dn: "):
return self.attributes[0][4:]
else:
return None
Expand All @@ -86,19 +86,20 @@ def edge(self, dnmap):
Element objects) and returns a string which declares a DOT edge, or an
empty string, if no parent was found.
"""
dn_components = self.dn().split(',')
dn_components = self.dn().split(",")
for i in range(1, len(dn_components) + 1):
parent = ','.join(dn_components[i:])
parent = ",".join(dn_components[i:])
if parent in dnmap:
return ' n%d->n%d\n' % (dnmap[parent].index, self.index)
return ''
return " n%d->n%d\n" % (dnmap[parent].index, self.index)
return ""

def dot(self, dnmap):
"""Returns a text representation of the node and perhaps its parent edge.
Args:
- dnmap: dictionary mapping dn names to Element objects
"""

def _format(attributes):
result = [TITLE_ENTRY_TEMPALTE % attributes[0]]

Expand All @@ -107,7 +108,12 @@ def _format(attributes):

return result

return TABLE_TEMPLATE % (self.index, '\n '.join(_format(self.attributes)), self.edge(dnmap))
return TABLE_TEMPLATE % (
self.index,
"\n ".join(_format(self.attributes)),
self.edge(dnmap),
)


class Converter:
"""An LDIF to DOT converter."""
Expand Down Expand Up @@ -144,7 +150,11 @@ def parse(self, file, name):
e = Element()
if e.is_valid():
self._append(e)
return (BASE_TEMPLATE % (name, ''.join([e.dot(self.dnmap) for e in self.elements])))
return BASE_TEMPLATE % (
name,
"".join([e.dot(self.dnmap) for e in self.elements]),
)


BASE_TEMPLATE = """\
strict digraph "%s" {
Expand Down Expand Up @@ -191,13 +201,13 @@ def parse(self, file, name):
"""


if __name__ == '__main__':
if __name__ == "__main__":
if len(sys.argv) > 2:
raise 'Expected at most one argument.'
raise "Expected at most one argument."
elif len(sys.argv) == 2:
name = sys.argv[1]
file = open(sys.argv[1], 'r')
file = open(sys.argv[1], "r")
else:
name = '<stdin>'
name = "<stdin>"
file = sys.stdin
print Converter().parse(file, name)
print(Converter().parse(file, name))
4 changes: 2 additions & 2 deletions locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"error_writing_file": "طرأ هناك خطأ أثناء الكتابة في الملف {file}: {error}",
"error_removing": "خطأ أثناء عملية حذف {path}: {error}",
"error_changing_file_permissions": "خطأ أثناء عملية تعديل التصريحات لـ {path}: {error}",
"invalid_url": "فشل الاتصال بـ {url} ... ربما تكون الخدمة معطلة ، أو أنك غير متصل بشكل صحيح بالإنترنت في IPv4 / IPv6.",
"invalid_url": "فشل الاتصال بـ {url} ربما تكون الخدمة معطلة ، أو أنك غير متصل بشكل صحيح بالإنترنت في IPv4 / IPv6.",
"download_ssl_error": "خطأ في الاتصال الآمن عبر الـ SSL أثناء محاولة الربط بـ {url}",
"download_timeout": "{url} استغرق مدة طويلة جدا للإستجابة، فتوقّف.",
"download_unknown_error": "خطأ أثناء عملية تنزيل البيانات مِن {url} : {error}",
Expand All @@ -44,4 +44,4 @@
"warn_the_user_about_waiting_lock": "هناك أمر لـ YunoHost قيد التشغيل حاليا. في انتظار انتهاء تنفيذه قبل تشغيل التالي",
"edit_text_question": "{}. تعديل هذا النص؟ [yN]: ",
"corrupted_toml": "قراءة مُشوّهة لملف TOML مِن {ressource} (السبب : {error})"
}
}
9 changes: 5 additions & 4 deletions locales/ca.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"argument_required": "Es requereix l'argument {argument}",
"argument_required": "Es requereix l'argument «{argument}»",
"authentication_required": "Es requereix autenticació",
"confirm": "Confirmar{prompt}",
"confirm": "Confirmar {prompt}",
"deprecated_command": "{prog}{command}és obsolet i es desinstal·larà en el futur",
"deprecated_command_alias": "{prog}{old}és obsolet i es desinstal·larà en el futur, utilitzeu {prog}{new}en el seu lloc",
"error": "Error:",
Expand Down Expand Up @@ -33,7 +33,7 @@
"error_writing_file": "Error al escriure el fitxer {file}: {error}",
"error_removing": "Error al eliminar {path}: {error}",
"error_changing_file_permissions": "Error al canviar els permisos per {path}: {error}",
"invalid_url": "URL invàlid {url} (el lloc web existeix?)",
"invalid_url": "No s'ha pogut connectar a {url}… pot ser que el servei estigui caigut, o que no hi hagi connexió a Internet amb IPv4/IPv6.",
"download_ssl_error": "Error SSL al connectar amb {url}",
"download_timeout": "{url} ha tardat massa en respondre, s'ha deixat d'esperar.",
"download_unknown_error": "Error al baixar dades des de {url}: {error}",
Expand All @@ -42,5 +42,6 @@
"corrupted_toml": "El fitxer TOML ha estat corromput en la lectura des de {ressource} (motiu: {error})",
"warn_the_user_about_waiting_lock": "Hi ha una altra ordre de YunoHost en execució, s'executarà aquesta ordre un cop l'anterior hagi acabat",
"warn_the_user_about_waiting_lock_again": "Encara en espera…",
"warn_the_user_that_lock_is_acquired": "L'altra ordre tot just ha acabat, ara s'executarà aquesta ordre"
"warn_the_user_that_lock_is_acquired": "L'altra ordre tot just ha acabat, ara s'executarà aquesta ordre",
"edit_text_question": "{}. Edita aquest text ? [yN]: "
}
6 changes: 3 additions & 3 deletions locales/cmn.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
"error_writing_file": "写入文件{file}失败:{error}",
"error_removing": "删除路径{path}失败:{error}",
"error_changing_file_permissions": "目录{path}权限修改失败:{error}",
"invalid_url": "{url} 连接失败... 可能是服务中断了,或者你没有正确连接到IPv4/IPv6的互联网。",
"invalid_url": "{url} 连接失败 可能是服务中断了,或者你没有正确连接到IPv4/IPv6的互联网。",
"download_ssl_error": "连接{url}时发生SSL错误",
"download_timeout": "{url}响应超时,放弃。",
"download_unknown_error": "下载{url}失败:{error}",
"download_bad_status_code": "{url}返回状态码:{code}",
"warn_the_user_that_lock_is_acquired": "另一个命令刚刚完成,现在启动此命令",
"warn_the_user_about_waiting_lock_again": "仍在等待...",
"warn_the_user_about_waiting_lock_again": "仍在等待",
"warn_the_user_about_waiting_lock": "目前正在运行另一个YunoHost命令,我们在运行此命令之前等待它完成",
"corrupted_toml": "从{ressource}读取的TOML已损坏(原因:{error})",
"edit_text_question": "{}.编辑此文本?[yN]: "
}
}
4 changes: 2 additions & 2 deletions locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"password": "Heslo",
"logged_out": "Jste odhlášen/a",
"warn_the_user_that_lock_is_acquired": "Předchozí operace dokončena, nyní spouštíme tuto",
"warn_the_user_about_waiting_lock_again": "Stále čekáme...",
"warn_the_user_about_waiting_lock_again": "Stále čekáme",
"warn_the_user_about_waiting_lock": "Jiná YunoHost operace právě probíhá, před spuštěním této čekáme na její dokončení",
"download_bad_status_code": "{url} vrátil stavový kód {code}",
"download_unknown_error": "Chyba při stahování dat z {url}: {error}",
Expand Down Expand Up @@ -44,4 +44,4 @@
"authentication_required": "Vyžadováno ověření",
"argument_required": "Je vyžadován argument '{argument}'",
"edit_text_question": "{}. Upravit tento text? [yN]: "
}
}
2 changes: 1 addition & 1 deletion locales/da.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
6 changes: 3 additions & 3 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
"cannot_open_file": "Datei {file} konnte nicht geöffnet werden (Ursache: {error})",
"corrupted_yaml": "Beschädigtes YAML gelesen von {ressource} (reason: {error})",
"warn_the_user_that_lock_is_acquired": "Der andere Befehl wurde gerade abgeschlossen, starte jetzt diesen Befehl",
"warn_the_user_about_waiting_lock_again": "Immer noch wartend...",
"warn_the_user_about_waiting_lock_again": "Immer noch wartend",
"warn_the_user_about_waiting_lock": "Ein anderer YunoHost Befehl läuft gerade, wir warten bis er fertig ist, bevor dieser laufen kann",
"download_bad_status_code": "{url} lieferte folgende(n) Status Code(s) {code}",
"download_unknown_error": "Fehler beim Herunterladen von Daten von {url}: {error}",
"download_timeout": "{url} brauchte zu lange zum Antworten, hab aufgegeben.",
"download_ssl_error": "SSL Fehler beim Verbinden zu {url}",
"invalid_url": "Konnte keine Verbindung zu {url} herstellen... vielleicht ist der Dienst ausgefallen, oder Sie sind nicht richtig mit dem Internet in IPv4/IPv6 verbunden.",
"invalid_url": "Konnte keine Verbindung zu {url} herstellen vielleicht ist der Dienst ausgefallen, oder Sie sind nicht richtig mit dem Internet in IPv4/IPv6 verbunden.",
"error_changing_file_permissions": "Fehler beim Ändern der Berechtigungen für {path}: {error}",
"error_removing": "Fehler beim Entfernen {path}: {error}",
"error_writing_file": "Fehler beim Schreiben von Datei {file}: {error}",
"corrupted_toml": "Beschädigtes TOML gelesen von {ressource} (reason: {error})",
"edit_text_question": "{}. Diesen Text bearbeiten? [yN]: "
}
}
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"error_writing_file": "Error when writing file {file}: {error}",
"error_removing": "Error when removing {path}: {error}",
"error_changing_file_permissions": "Error when changing permissions for {path}: {error}",
"invalid_url": "Failed to connect to {url} ... maybe the service is down, or you are not properly connected to the Internet in IPv4/IPv6.",
"invalid_url": "Failed to connect to {url}... maybe the service is down, or you are not properly connected to the Internet in IPv4/IPv6.",
"download_ssl_error": "SSL error when connecting to {url}",
"download_timeout": "{url} took too long to answer, gave up.",
"download_unknown_error": "Error when downloading data from {url}: {error}",
Expand Down
4 changes: 2 additions & 2 deletions locales/eo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"password": "Pasvorto",
"warn_the_user_that_lock_is_acquired": "La alia komando ĵus kompletigis, nun komencante ĉi tiun komandon",
"warn_the_user_about_waiting_lock_again": "Ankoraŭ atendanta...",
"warn_the_user_about_waiting_lock_again": "Ankoraŭ atendanta",
"warn_the_user_about_waiting_lock": "Alia komando de YunoHost funkcias ĝuste nun, ni atendas, ke ĝi finiĝos antaŭ ol funkcii ĉi tiu",
"download_bad_status_code": "{url} redonita statuskodo {code}",
"download_unknown_error": "Eraro dum elŝutado de datumoj de {url}: {error}",
Expand All @@ -16,7 +16,7 @@
"corrupted_json": "Koruptita JSON legis de {ressource} (Kialo: {error})",
"unknown_error_reading_file": "Nekonata eraro dum provi legi dosieron {file} (kialo: {error})",
"cannot_write_file": "Ne povis skribi dosieron {file} (kialo: {error})",
"cannot_open_file": "Ne povis malfermi dosieron {file: s} (kialo: {error: s})",
"cannot_open_file": "Ne povis malfermi dosieron {file} (kialo: {error})",
"websocket_request_expected": "Atendis ret-peto",
"warning": "Averto:",
"values_mismatch": "Valoroj ne kongruas",
Expand Down
4 changes: 2 additions & 2 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"error_writing_file": "Error al escribir el archivo {file}: {error}",
"error_removing": "Error al eliminar {path}: {error}",
"error_changing_file_permissions": "Error al cambiar los permisos para {path}: {error}",
"invalid_url": "URL inválida {url} (¿Existe este sitio?).",
"invalid_url": "Imposible de conectarse a {url} (¿ la URL esta correcta, existe este sitio, o internet esta accesible?).",
"download_ssl_error": "Error SSL al conectar con {url}",
"download_timeout": "{url} tardó demasiado en responder, abandono.",
"download_unknown_error": "Error al descargar datos desde {url} : {error}",
Expand All @@ -41,7 +41,7 @@
"info": "Información:",
"corrupted_toml": "Lectura corrupta de TOML desde {ressource} (motivo: {error})",
"warn_the_user_that_lock_is_acquired": "La otra orden recién terminó, iniciando esta orden ahora",
"warn_the_user_about_waiting_lock_again": "Aún esperando...",
"warn_the_user_about_waiting_lock_again": "Aún esperando",
"warn_the_user_about_waiting_lock": "Otra orden de YunoHost se está ejecutando ahora, estamos esperando a que termine antes de ejecutar esta",
"edit_text_question": "{}. Editar este texto ? [sN]: "
}
Loading

0 comments on commit ed6ad7b

Please sign in to comment.