Style: fix redundant parentheses and typos

(cherry picked from commit cd89684ce633c4997b328395cc882de3ab655475)
This commit is contained in:
Ziyue Pan 2023-03-23 14:24:56 +08:00 committed by Michael Opdenacker
parent 67562314e1
commit 7c4886cf3c
4 changed files with 28 additions and 28 deletions

View file

@ -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
----

4
lib.py
View file

@ -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:

View file

@ -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):

View file

@ -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