[copr] master: Joining with whitespaces seems to be more convenient, since split removes arbitrary number of whitespace. (c4bd43d)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Mon Jan 28 09:30:23 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit c4bd43d8faeb6083858552d240ad1362fdb4a90a
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Mon Jan 28 09:26:49 2013 +0100

    Joining with whitespaces seems to be more convenient, since split removes arbitrary number of whitespace.


>---------------------------------------------------------------

 copr_cli/subcommands.py                          |    4 ++--
 coprs_frontend/coprs/views/api_ns/api_general.py |    6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/copr_cli/subcommands.py b/copr_cli/subcommands.py
index 9de7a9d..b91ce0c 100644
--- a/copr_cli/subcommands.py
+++ b/copr_cli/subcommands.py
@@ -88,10 +88,10 @@ class AddCopr(Command):
 
         repos = None
         if args.repos:
-            repos = ",".join(args.repos)
+            repos = ' '.join(args.repos)
         initial_pkgs = None
         if args.initial_pkgs:
-            initial_pkgs = ",".join(args.initial_pkgs)
+            initial_pkgs = ' '.join(args.initial_pkgs)
         data = {'name': args.name,
                 'repos': repos,
                 'initial_pkgs': initial_pkgs,
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py b/coprs_frontend/coprs/views/api_ns/api_general.py
index 19d5bb7..a5c94ca 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -72,8 +72,7 @@ def api_new_copr():
         try:
             copr = coprs_logic.CoprsLogic.add(
                 name=form.name.data.strip(),
-                repos=" ".join([repo.strip()
-                    for repo in form.repos.data.split(',')]),
+                repos=" ".join(form.repos.data.split()),
                 user=flask.g.user,
                 selected_chroots=form.selected_chroots,
                 description=form.description.data,
@@ -84,8 +83,7 @@ def api_new_copr():
 
             if form.initial_pkgs.data:
                 builds_logic.BuildsLogic.add_build(
-                    pkgs=" ".join([pkg.strip()
-                        for pkg in form.initial_pkgs.data.split(',')]),
+                    pkgs=" ".join(form.initial_pkgs.data.split()),
                     copr=copr,
                     owner=flask.g.user)
                 infos.append('Initial packages were successfully submitted '



More information about the copr-devel mailing list