Address a handful of python warnings
This commit is contained in:
parent
14524646b9
commit
7a5f919e44
@ -361,7 +361,7 @@ class TVBGetBits:
|
|||||||
for m in matches:
|
for m in matches:
|
||||||
try:
|
try:
|
||||||
length = int(m.group(2))
|
length = int(m.group(2))
|
||||||
except:
|
except Exception:
|
||||||
# Not parsable as literal decimal, so ignore
|
# Not parsable as literal decimal, so ignore
|
||||||
# TODO: could subst macros if e.g., do check in check_against_items()
|
# TODO: could subst macros if e.g., do check in check_against_items()
|
||||||
continue
|
continue
|
||||||
|
@ -205,7 +205,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
with io.open(iana_path, 'w', encoding='UTF-8') as iana_f:
|
with io.open(iana_path, 'w', encoding='UTF-8') as iana_f:
|
||||||
iana_f.write(iana_data)
|
iana_f.write(iana_data)
|
||||||
except:
|
except Exception:
|
||||||
exit_msg("Couldn't open \"{}\" file for writing".format(iana_path))
|
exit_msg("Couldn't open \"{}\" file for writing".format(iana_path))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -3,6 +3,7 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
import itertools
|
import itertools
|
||||||
import lxml.etree
|
import lxml.etree
|
||||||
|
import re
|
||||||
|
|
||||||
# This utility scrapes the DICOM standard document in DocBook format, finds the appropriate tables,
|
# This utility scrapes the DICOM standard document in DocBook format, finds the appropriate tables,
|
||||||
# and extracts the data needed to build the lists of DICOM attributes, UIDs and value representations.
|
# and extracts the data needed to build the lists of DICOM attributes, UIDs and value representations.
|
||||||
@ -137,7 +138,6 @@ def uid_define_name(uid):
|
|||||||
uid_name = uid_name[:-len(uid_type)].strip()
|
uid_name = uid_name[:-len(uid_type)].strip()
|
||||||
return f"DCM_UID_{definify(uid_type)}_{definify(uid_name)}"
|
return f"DCM_UID_{definify(uid_type)}_{definify(uid_name)}"
|
||||||
|
|
||||||
import re
|
|
||||||
def definify(s):
|
def definify(s):
|
||||||
return re.sub('[^A-Z0-9]+', '_', re.sub(' +', ' ', re.sub('[^-A-Z0-9 ]+', '', s.upper())))
|
return re.sub('[^A-Z0-9]+', '_', re.sub(' +', ' ', re.sub('[^-A-Z0-9 ]+', '', s.upper())))
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ def generate_version_h(repo_data):
|
|||||||
|
|
||||||
if repo_data.get('commit_id'):
|
if repo_data.get('commit_id'):
|
||||||
ws_commit_id_line = f'#define WIRESHARK_VCS_COMMIT_ID "{repo_data["commit_id"]}"'
|
ws_commit_id_line = f'#define WIRESHARK_VCS_COMMIT_ID "{repo_data["commit_id"]}"'
|
||||||
ss_commit_id_line = f'#define STRATOSHARK_VCS_COMMIT_ID WIRESHARK_VCS_COMMIT_ID'
|
ss_commit_id_line = '#define STRATOSHARK_VCS_COMMIT_ID WIRESHARK_VCS_COMMIT_ID'
|
||||||
|
|
||||||
if repo_data.get('enable_vcsversion'):
|
if repo_data.get('enable_vcsversion'):
|
||||||
if repo_data.get('ws_git_description'):
|
if repo_data.get('ws_git_description'):
|
||||||
|
@ -32,7 +32,6 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from string import Template
|
|
||||||
|
|
||||||
def parse_desc(description):
|
def parse_desc(description):
|
||||||
'''\
|
'''\
|
||||||
@ -450,7 +449,7 @@ def main():
|
|||||||
adoc_f.write(functions[global_id].to_adoc())
|
adoc_f.write(functions[global_id].to_adoc())
|
||||||
|
|
||||||
if len(functions.keys()) > 0:
|
if len(functions.keys()) > 0:
|
||||||
adoc_f.write(f'// Global function\n')
|
adoc_f.write('// Global function\n')
|
||||||
|
|
||||||
adoc_f.write('// end of module\n')
|
adoc_f.write('// end of module\n')
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ and save it in a packet-capture file.
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
# TODO: update to python3
|
||||||
|
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -141,7 +141,7 @@ class SharkdShell:
|
|||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
_logger.error('Invalid command: %s', e)
|
_logger.error('Invalid command: %s', e)
|
||||||
return
|
return
|
||||||
if type(c) != dict or not 'req' in c:
|
if c is not dict or 'req' not in c:
|
||||||
_logger.error('Missing req key in request')
|
_logger.error('Missing req key in request')
|
||||||
return
|
return
|
||||||
return c
|
return c
|
||||||
|
@ -843,7 +843,7 @@ class wireshark_gen_C:
|
|||||||
if ex.members():
|
if ex.members():
|
||||||
#print ex.members()
|
#print ex.members()
|
||||||
for m in ex.members():
|
for m in ex.members():
|
||||||
t = 0
|
pass
|
||||||
#print m.memberType(), m.memberType().kind()
|
#print m.memberType(), m.memberType().kind()
|
||||||
|
|
||||||
def genOpDelegator(self, oplist):
|
def genOpDelegator(self, oplist):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user