From 7c4886cf3c92b569765e0c991fb68fd2f34dafc4 Mon Sep 17 00:00:00 2001 From: Ziyue Pan Date: Thu, 23 Mar 2023 14:24:56 +0800 Subject: [PATCH] Style: fix redundant parentheses and typos (cherry picked from commit cd89684ce633c4997b328395cc882de3ab655475) --- README.adoc | 4 ++-- lib.py | 4 ++-- query.py | 6 +++--- update.py | 42 +++++++++++++++++++++--------------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.adoc b/README.adoc index 02cf9cf..7253a8f 100644 --- a/README.adoc +++ b/README.adoc @@ -65,7 +65,7 @@ A detailed diagram of the databases will be provided. Until then, just use the S = Manual Installation -== Install Dependences +== Install Dependencies ____ For RedHat/Fedora/AlmaLinux @@ -289,7 +289,7 @@ To check if it takes effect, run the following codes: ls -Z /path/elixir-data/ ---- -In case you want to check SELinux log releated with httpd, run the following codes: +In case you want to check SELinux log related with httpd, run the following codes: ---- audit2why -a | grep httpd | less ---- diff --git a/lib.py b/lib.py index 43ff082..bea8a16 100755 --- a/lib.py +++ b/lib.py @@ -228,13 +228,13 @@ compatibility_list = { # Check if families are compatible # First argument can be a list of different families -# Second argument is the key for chossing the right array in the compatibility list +# Second argument is the key for choosing the right array in the compatibility list def compatibleFamily(file_family, requested_family): return any(item in file_family for item in compatibility_list[requested_family]) # Check if a macro is compatible with the requested family # First argument can be a list of different families -# Second argument is the key for chossing the right array in the compatibility list +# Second argument is the key for choosing the right array in the compatibility list def compatibleMacro(macro_family, requested_family): result = False for item in macro_family: diff --git a/query.py b/query.py index 7dd39f5..2584f85 100755 --- a/query.py +++ b/query.py @@ -60,11 +60,11 @@ def query(cmd, *args): num = len(taginfo) topmenu, submenu = 'FIXME', 'FIXME' - if (num == 1): + if num == 1: tag, = taginfo - elif (num == 2): + elif num == 2: submenu,tag = taginfo - elif (num ==3): + elif num ==3: topmenu,submenu,tag = taginfo if db.vers.exists(tag): diff --git a/update.py b/update.py index 61c9a35..ae662f9 100755 --- a/update.py +++ b/update.py @@ -142,7 +142,7 @@ class UpdateVersions(Thread): index = 0 while index < len(self.tag_buf): - if(index >= len(new_idxes)): + if index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -193,13 +193,13 @@ class UpdateDefs(Thread): def __init__(self, start, inc): Thread.__init__(self, name="UpdateDefsElixir") self.index = start - self.inc = inc # Equivalient to the number of defs threads + self.inc = inc # Equivalent to the number of defs threads def run(self): global new_idxes, tags_done, tag_ready, tags_defs, tags_defs_lock - while(not (tags_done and self.index >= len(new_idxes))): - if(self.index >= len(new_idxes)): + while not (tags_done and self.index >= len(new_idxes)): + if self.index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -225,7 +225,7 @@ class UpdateDefs(Thread): global hash_file_lock, defs_lock, tags_defs for idx in idxes: - if (idx % 1000 == 0): progress('defs: ' + str(idx), tags_defs[0]) + if idx % 1000 == 0: progress('defs: ' + str(idx), tags_defs[0]) with hash_file_lock: hash = db.hash.get(idx) @@ -261,13 +261,13 @@ class UpdateRefs(Thread): def __init__(self, start, inc): Thread.__init__(self, name="UpdateRefsElixir") self.index = start - self.inc = inc # Equivalient to the number of refs threads + self.inc = inc # Equivalent to the number of refs threads def run(self): global new_idxes, tags_done, tags_refs, tags_refs_lock - while(not (tags_done and self.index >= len(new_idxes))): - if(self.index >= len(new_idxes)): + while not (tags_done and self.index >= len(new_idxes)): + if self.index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -291,7 +291,7 @@ class UpdateRefs(Thread): global hash_file_lock, defs_lock, refs_lock, tags_refs for idx in idxes: - if (idx % 1000 == 0): progress('refs: ' + str(idx), tags_refs[0]) + if idx % 1000 == 0: progress('refs: ' + str(idx), tags_refs[0]) with hash_file_lock: hash = db.hash.get(idx) @@ -345,13 +345,13 @@ class UpdateDocs(Thread): def __init__(self, start, inc): Thread.__init__(self, name="UpdateDocsElixir") self.index = start - self.inc = inc # Equivalient to the number of docs threads + self.inc = inc # Equivalent to the number of docs threads def run(self): global new_idxes, tags_done, tags_docs, tags_docs_lock - while(not (tags_done and self.index >= len(new_idxes))): - if(self.index >= len(new_idxes)): + while not (tags_done and self.index >= len(new_idxes)): + if self.index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -374,7 +374,7 @@ class UpdateDocs(Thread): global hash_file_lock, docs_lock, tags_docs for idx in idxes: - if (idx % 1000 == 0): progress('docs: ' + str(idx), tags_docs[0]) + if idx % 1000 == 0: progress('docs: ' + str(idx), tags_docs[0]) with hash_file_lock: hash = db.hash.get(idx) @@ -404,13 +404,13 @@ class UpdateComps(Thread): def __init__(self, start, inc): Thread.__init__(self, name="UpdateCompsElixir") self.index = start - self.inc = inc # Equivalient to the number of comps threads + self.inc = inc # Equivalent to the number of comps threads def run(self): global new_idxes, tags_done, tags_comps, tags_comps_lock - while(not (tags_done and self.index >= len(new_idxes))): - if(self.index >= len(new_idxes)): + while not (tags_done and self.index >= len(new_idxes)): + if self.index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -435,7 +435,7 @@ class UpdateComps(Thread): global hash_file_lock, comps_lock, tags_comps for idx in idxes: - if (idx % 1000 == 0): progress('comps: ' + str(idx), tags_comps[0]) + if idx % 1000 == 0: progress('comps: ' + str(idx), tags_comps[0]) with hash_file_lock: hash = db.hash.get(idx) @@ -471,13 +471,13 @@ class UpdateCompsDocs(Thread): def __init__(self, start, inc): Thread.__init__(self, name="UpdateCompsDocsElixir") self.index = start - self.inc = inc # Equivalient to the number of comps_docs threads + self.inc = inc # Equivalent to the number of comps_docs threads def run(self): global new_idxes, tags_done, tags_comps_docs, tags_comps_docs_lock - while(not (tags_done and self.index >= len(new_idxes))): - if(self.index >= len(new_idxes)): + while not (tags_done and self.index >= len(new_idxes)): + if self.index >= len(new_idxes): # Wait for new tags with tag_ready: tag_ready.wait() @@ -502,7 +502,7 @@ class UpdateCompsDocs(Thread): global hash_file_lock, comps_lock, comps_docs_lock, tags_comps_docs, bindings_idxes for idx in idxes: - if (idx % 1000 == 0): progress('comps_docs: ' + str(idx), tags_comps_docs[0]) + if idx % 1000 == 0: progress('comps_docs: ' + str(idx), tags_comps_docs[0]) if not idx in bindings_idxes: # Parse only bindings doc files continue