aboutsummaryrefslogtreecommitdiff
path: root/contrib/scripts
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-10-12 18:17:27 +0000
committerng0 <ng0@n0.is>2019-10-12 18:17:27 +0000
commit3371f389918feb4b428dfd129464c555852b4189 (patch)
tree1f08a65a70869835fa6ed20e614252ac72921611 /contrib/scripts
parenta5f5e7ed9b07b902af4438d76087e034abcba9b2 (diff)
downloadgnunet-3371f389918feb4b428dfd129464c555852b4189.tar.gz
gnunet-3371f389918feb4b428dfd129464c555852b4189.zip
more python format
Diffstat (limited to 'contrib/scripts')
-rw-r--r--contrib/scripts/find_typedefs.py6
-rw-r--r--contrib/scripts/gdb-iterate-dll.py3
2 files changed, 5 insertions, 4 deletions
diff --git a/contrib/scripts/find_typedefs.py b/contrib/scripts/find_typedefs.py
index 804eae235..965be3c34 100644
--- a/contrib/scripts/find_typedefs.py
+++ b/contrib/scripts/find_typedefs.py
@@ -4,7 +4,6 @@ import os
4import re 4import re
5import sys 5import sys
6 6
7
8debug = False 7debug = False
9 8
10 9
@@ -14,7 +13,8 @@ def get_td_from_function_signature(line, file, num):
14 left_paren += 1 13 left_paren += 1
15 li = line[left_paren:] 14 li = line[left_paren:]
16 right_paren = line.find(')') 15 right_paren = line.find(')')
17 if right_paren > 0 and right_paren > left_paren and line[right_paren:].find('(') >= 0: 16 if right_paren > 0 and right_paren > left_paren and line[
17 right_paren:].find('(') >= 0:
18 fname = line[:right_paren] 18 fname = line[:right_paren]
19 fname = fname.lstrip(' ').lstrip('*').lstrip(' ').rstrip(' ') 19 fname = fname.lstrip(' ').lstrip('*').lstrip(' ').rstrip(' ')
20 if len(fname) > 0: 20 if len(fname) > 0:
@@ -70,7 +70,7 @@ def find_typedefs(file):
70 td_line.append(l[rightcbrace + 1:]) 70 td_line.append(l[rightcbrace + 1:])
71 else: 71 else:
72 td_line.append(l) 72 td_line.append(l)
73 if len(l) > 0 and l[-1] == ';' and(not td_struct or td_level == 0): 73 if len(l) > 0 and l[-1] == ';' and (not td_struct or td_level == 0):
74 td_line = ' '.join(td_line) 74 td_line = ' '.join(td_line)
75 td_line = td_line[:-1] 75 td_line = td_line[:-1]
76 if len(td_line) > 0: 76 if len(td_line) > 0:
diff --git a/contrib/scripts/gdb-iterate-dll.py b/contrib/scripts/gdb-iterate-dll.py
index 79d46aa96..28c435ccb 100644
--- a/contrib/scripts/gdb-iterate-dll.py
+++ b/contrib/scripts/gdb-iterate-dll.py
@@ -23,7 +23,8 @@ def search_dll(head, field, match, pfield):
23 if field_val.type.code == gdb.TYPE_CODE_INT: 23 if field_val.type.code == gdb.TYPE_CODE_INT:
24 val = int(field_val) 24 val = int(field_val)
25 res = (match == val) 25 res = (match == val)
26 elif (field_val.type.code == gdb.TYPE_CODE_STRING) or (field_val.type.code == gdb.TYPE_CODE_ARRAY): 26 elif (field_val.type.code == gdb.TYPE_CODE_STRING
27 ) or (field_val.type.code == gdb.TYPE_CODE_ARRAY):
27 val = str(field_val) 28 val = str(field_val)
28 res = (match == val) 29 res = (match == val)
29 elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): 30 elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF):