From a82562b7946387979213eb57e64a9b764f8b2be9 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Mon, 17 Oct 2022 19:54:47 +0200 Subject: [PATCH] Move modules into lib subdir --- git-importer.py | 2 +- binary.py => lib/binary.py | 0 config.py => lib/config.py | 0 db.py => lib/db.py | 0 git.py => lib/git.py | 11 ++++++----- history.py => lib/history.py | 6 +++--- importer.py => lib/importer.py | 10 +++++----- obs.py => lib/obs.py | 16 +++++++++------- proxy_sha256.py => lib/proxy_sha256.py | 7 ++++--- request.py => lib/request.py | 0 revision.py => lib/revision.py | 2 +- 11 files changed, 29 insertions(+), 25 deletions(-) rename binary.py => lib/binary.py (100%) rename config.py => lib/config.py (100%) rename db.py => lib/db.py (100%) rename git.py => lib/git.py (99%) rename history.py => lib/history.py (99%) rename importer.py => lib/importer.py (98%) rename obs.py => lib/obs.py (99%) rename proxy_sha256.py => lib/proxy_sha256.py (99%) rename request.py => lib/request.py (100%) rename revision.py => lib/revision.py (100%) diff --git a/git-importer.py b/git-importer.py index dca5f95..4dfe083 100755 --- a/git-importer.py +++ b/git-importer.py @@ -8,7 +8,7 @@ import sys import osc.core -from importer import Importer +from lib.importer import Importer URL_OBS = "https://api.opensuse.org" URL_IBS = "https://api.suse.de" diff --git a/binary.py b/lib/binary.py similarity index 100% rename from binary.py rename to lib/binary.py diff --git a/config.py b/lib/config.py similarity index 100% rename from config.py rename to lib/config.py diff --git a/db.py b/lib/db.py similarity index 100% rename from db.py rename to lib/db.py diff --git a/git.py b/lib/git.py similarity index 99% rename from git.py rename to lib/git.py index c63da49..2dbdb40 100644 --- a/git.py +++ b/lib/git.py @@ -1,10 +1,11 @@ -import pathlib -import pygit2 -import logging -import subprocess import fnmatch +import logging +import pathlib +import subprocess -from binary import BINARY +import pygit2 + +from lib.binary import BINARY LFS_SUFFIX = "filter=lfs diff=lfs merge=lfs -text" diff --git a/history.py b/lib/history.py similarity index 99% rename from history.py rename to lib/history.py index f66a132..8984353 100644 --- a/history.py +++ b/lib/history.py @@ -1,8 +1,8 @@ -import re -import logging import itertools +import logging +import re -from revision import Revision +from lib.revision import Revision class History: diff --git a/importer.py b/lib/importer.py similarity index 98% rename from importer.py rename to lib/importer.py index c049983..e7906d4 100644 --- a/importer.py +++ b/lib/importer.py @@ -1,11 +1,11 @@ import functools import logging -from git import Git -from history import History -from binary import is_binary_or_large -from proxy_sha256 import ProxySHA256, md5, sha256 -from obs import OBS +from lib.binary import is_binary_or_large +from lib.git import Git +from lib.history import History +from lib.obs import OBS +from lib.proxy_sha256 import ProxySHA256, md5, sha256 def _files_hash(hash_alg, dirpath): diff --git a/obs.py b/lib/obs.py similarity index 99% rename from obs.py rename to lib/obs.py index 2de5a11..2ecf241 100644 --- a/obs.py +++ b/lib/obs.py @@ -1,12 +1,14 @@ -import osc.core -import xml.etree.ElementTree as ET -import logging -import urllib.parse -from urllib.error import HTTPError -import time import errno +import logging +import time +import urllib.parse +import xml.etree.ElementTree as ET +from urllib.error import HTTPError + +import osc.core + +from lib.request import Request -from request import Request # Add a retry wrapper for some of the HTTP actions. def retry(func): diff --git a/proxy_sha256.py b/lib/proxy_sha256.py similarity index 99% rename from proxy_sha256.py rename to lib/proxy_sha256.py index 1d55cb2..26b4340 100644 --- a/proxy_sha256.py +++ b/lib/proxy_sha256.py @@ -1,8 +1,9 @@ -import logging -import requests -import urllib import functools import hashlib +import logging +import urllib + +import requests def _hash(hash_alg, file_or_path): diff --git a/request.py b/lib/request.py similarity index 100% rename from request.py rename to lib/request.py diff --git a/revision.py b/lib/revision.py similarity index 100% rename from revision.py rename to lib/revision.py index f64cb98..c0c0643 100644 --- a/revision.py +++ b/lib/revision.py @@ -1,8 +1,8 @@ import datetime import logging import re -from urllib.error import HTTPError import xml.etree.ElementTree as ET +from urllib.error import HTTPError class Revision: