diff options
| author | Ben McGinnes <[email protected]> | 2018-05-24 19:22:16 +0000 | 
|---|---|---|
| committer | Ben McGinnes <[email protected]> | 2018-05-24 19:50:11 +0000 | 
| commit | 48e946a96d05effd56b34761b98eebb6b2a6fae1 (patch) | |
| tree | de8945cc0d51ce532eccec7b19786e64051fa215 | |
| parent | doc: python bindings howto (diff) | |
| download | gpgme-48e946a96d05effd56b34761b98eebb6b2a6fae1.tar.gz gpgme-48e946a96d05effd56b34761b98eebb6b2a6fae1.zip  | |
docs: python bindings howto
* Fixed the groups.py script so it really does what is described (the
  old code had the same result for groups, group_lines and
  group_lists).
* Updated the corresponding example in the doc to match.
| -rw-r--r-- | lang/python/docs/GPGMEpythonHOWTOen.org | 12 | ||||
| -rw-r--r-- | lang/python/examples/howto/groups.py | 10 | 
2 files changed, 13 insertions, 9 deletions
diff --git a/lang/python/docs/GPGMEpythonHOWTOen.org b/lang/python/docs/GPGMEpythonHOWTOen.org index d7a1891f..c9397bcf 100644 --- a/lang/python/docs/GPGMEpythonHOWTOen.org +++ b/lang/python/docs/GPGMEpythonHOWTOen.org @@ -1348,15 +1348,17 @@  	 if lines[i].startswith("group") is True:  	     line = lines[i]  	 else: -	     pass +		 pass       groups = line.split(":")[-1].replace('"', '').split(',') -     group_lines = groups -     for i in range(len(group_lines)): -	 group_lines[i] = group_lines[i].split("=") +     group_lines = [] +     group_lists = [] + +     for i in range(len(groups)): +	 group_lines.append(groups[i].split("=")) +	 group_lists.append(groups[i].split("=")) -     group_lists = group_lines       for i in range(len(group_lists)):  	 group_lists[i][1] = group_lists[i][1].split()     #+end_src diff --git a/lang/python/examples/howto/groups.py b/lang/python/examples/howto/groups.py index 5e7fdf60..fe31d7f5 100644 --- a/lang/python/examples/howto/groups.py +++ b/lang/python/examples/howto/groups.py @@ -41,10 +41,12 @@ for i in range(len(lines)):  groups = line.split(":")[-1].replace('"', '').split(',') -group_lines = groups -for i in range(len(group_lines)): -    group_lines[i] = group_lines[i].split("=") +group_lines = [] +group_lists = [] + +for i in range(len(groups)): +    group_lines.append(groups[i].split("=")) +    group_lists.append(groups[i].split("=")) -group_lists = group_lines  for i in range(len(group_lists)):      group_lists[i][1] = group_lists[i][1].split()  | 
