git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8e61d63
)
python: Convert any iterable argument to a list (RHBZ#693324).
author
Richard W.M. Jones
<rjones@redhat.com>
Mon, 4 Apr 2011 11:48:02 +0000
(12:48 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 4 Apr 2011 11:48:02 +0000
(12:48 +0100)
Thanks to Erez Shinan.
generator/generator_python.ml
patch
|
blob
|
history
diff --git
a/generator/generator_python.ml
b/generator/generator_python.ml
index
937c092
..
9514e4a
100644
(file)
--- a/
generator/generator_python.ml
+++ b/
generator/generator_python.ml
@@
-1,5
+1,5
@@
(* libguestfs
(* libguestfs
- * Copyright (C) 2009-201
0
Red Hat Inc.
+ * Copyright (C) 2009-201
1
Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-647,6
+647,18
@@
class GuestFS:
let doc = String.concat "\n " doc in
pr " u\"\"\"%s\"\"\"\n" doc;
);
let doc = String.concat "\n " doc in
pr " u\"\"\"%s\"\"\"\n" doc;
);
+ (* Callers might pass in iterables instead of plain lists;
+ * convert those to plain lists because the C side of things
+ * cannot deal with iterables. (RHBZ#693306).
+ *)
+ List.iter (
+ function
+ | Pathname _ | Device _ | Dev_or_Path _ | String _ | Key _
+ | FileIn _ | FileOut _ | OptString _ | Bool _ | Int _ | Int64 _
+ | BufferIn _ | Pointer _ -> ()
+ | StringList n | DeviceList n ->
+ pr " %s = list (%s)\n" n n
+ ) args;
pr " return libguestfsmod.%s (self._o" name;
List.iter (fun arg -> pr ", %s" (name_of_argt arg)) (args@optargs);
pr ")\n\n";
pr " return libguestfsmod.%s (self._o" name;
List.iter (fun arg -> pr ", %s" (name_of_argt arg)) (args@optargs);
pr ")\n\n";