[elbe-devel] [PATCH 13/21] elbepack: soapclient: make set_orig a method on ElbeSoapClient
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Tue Aug 6 11:18:11 CEST 2024
This is useful functionality that should be usable without going through
"elbe control".
Make it a library function that can be called from other parts of elbe
and call it from "elbe control".
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/commands/control.py | 4 +---
elbepack/soapclient.py | 6 ++++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 23f651039793..0bcd81e6f515 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -202,9 +202,7 @@ def _set_cdrom(client, args):
@_add_project_dir_argument
@add_argument('orig_file')
def _set_orig(client, args):
- client.service.start_upload_orig(args.project_dir, os.path.basename(args.orig_file))
- client.upload_file(client.service.append_upload_orig, args.project_dir, args.orig_file)
- client.service.finish_upload_orig(args.project_dir)
+ client.set_orig(args.project_dir, args.orig_file)
@add_argument('--profile', dest='profile', default='',
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 230220b37163..10ca007cb3a4 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -5,6 +5,7 @@
import binascii
import logging
+import os
import socket
import sys
import time
@@ -207,3 +208,8 @@ class ElbeSoapClient:
if part == -2:
_logger.debug('upload of xml finished')
return
+
+ def set_orig(self, builddir, orig_file):
+ self.service.start_upload_orig(builddir, os.path.basename(orig_file))
+ self.upload_file(self.service.append_upload_orig, builddir, orig_file)
+ self.service.finish_upload_orig(builddir)
--
2.46.0
More information about the elbe-devel
mailing list