1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-19 08:42:11 +01:00

Load most of the modules in commandline.py on-demand

This commit is contained in:
Daniel Mach 2024-11-26 15:31:00 +01:00
parent c7b8f25fe6
commit 7ed288b838
4 changed files with 813 additions and 21 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,7 @@
import difflib
import osc.commandline
from .. import obs_api
from .. import oscerr
from ..output import get_user_input
class RepoAddCommand(osc.commandline.OscCommand):
@ -54,6 +52,9 @@ class RepoAddCommand(osc.commandline.OscCommand):
)
def run(self, args):
from .. import obs_api
from ..output import get_user_input
paths = []
for path in args.paths:
if "/" not in path:

View File

@ -1,6 +1,4 @@
import osc.commandline
from .. import obs_api
from ..output import KeyValueTable
class RepoListCommand(osc.commandline.OscCommand):
@ -19,6 +17,9 @@ class RepoListCommand(osc.commandline.OscCommand):
)
def run(self, args):
from .. import obs_api
from ..output import KeyValueTable
project_obj = obs_api.Project.from_api(args.apiurl, args.project)
repo_flags = project_obj.resolve_repository_flags()

View File

@ -1,9 +1,7 @@
import difflib
import osc.commandline
from .. import obs_api
from .. import oscerr
from ..output import get_user_input
class RepoRemoveCommand(osc.commandline.OscCommand):
@ -34,6 +32,9 @@ class RepoRemoveCommand(osc.commandline.OscCommand):
)
def run(self, args):
from .. import obs_api
from ..output import get_user_input
project_obj = obs_api.Project.from_api(args.apiurl, args.project)
old = project_obj.to_string()