packages/python/python-cliff/new-cmd2.patch

47 lines
1.7 KiB
Diff

commit 6c1ddf273f026d9a0daff8305cd98b4516b8f447
Author: Felix Yan <felixonmars@archlinux.org>
Date: Thu Mar 12 08:10:53 2020 +0800
Fix compatibility with new cmd2
Change-Id: I8c926152aa43359be376ec3dea83c42ecc499e80
diff --git a/cliff/interactive.py b/cliff/interactive.py
index 4341d09..473f59a 100644
--- a/cliff/interactive.py
+++ b/cliff/interactive.py
@@ -175,9 +175,16 @@ class InteractiveApp(cmd2.Cmd):
statement.parsed.args = ' '.join(sub_argv)
else:
# cmd2 >= 0.9.1 uses shlex and gives us a Statement.
- statement.command = cmd_name
- statement.argv = [cmd_name] + sub_argv
- statement.args = ' '.join(statement.argv)
+ statement = cmd2.Statement(' '.join(sub_argv),
+ raw=statement.raw,
+ command=cmd_name,
+ arg_list=sub_argv,
+ multiline_command=statement.multiline_command,
+ terminator=statement.terminator,
+ suffix=statement.suffix,
+ pipe_to=statement.pipe_to,
+ output=statement.output,
+ output_to=statement.output_to)
return statement
def cmdloop(self):
diff --git a/requirements.txt b/requirements.txt
index c5f88ce..f89f1da 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
-cmd2>=0.8.0,!=0.8.3,<0.9.0 # MIT
+cmd2!=0.8.3,<0.9.0;python_version<'3.0' # MIT
+cmd2!=0.8.3;python_version>='3.0' # MIT
PrettyTable<0.8,>=0.7.2 # BSD
pyparsing>=2.1.0 # MIT
six>=1.10.0 # MIT