Skip to content

Commit 3685395

Browse files
committed
Fixed pylint CQ issues of class_sqlThread module
1 parent 04ae510 commit 3685395

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

src/class_sqlThread.py

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ def __init__(self):
2727
threading.Thread.__init__(self, name="SQL")
2828

2929
def update_sent(self):
30-
# After code refactoring, the possible status values for sent messages
31-
# have changed.
30+
"""
31+
After code refactoring, the possible status values for sent messages
32+
have changed.
33+
"""
3234
self.cur.execute(
3335
'''update sent set status='doingmsgpow' where status='doingpow' ''')
3436
self.cur.execute(
@@ -40,8 +42,10 @@ def update_sent(self):
4042
self.conn.commit()
4143

4244
def versionTwo(self):
43-
# Let's get rid of the first20bytesofencryptedmessage field in
44-
# the inventory table.
45+
"""
46+
method for getting rid of the first20bytesofencryptedmessage field in
47+
the inventory table.
48+
"""
4549
logger.debug(
4650
'In messages.dat database, removing an obsolete field from'
4751
' the inventory table.')
@@ -66,7 +70,7 @@ def versionTwo(self):
6670
self.cur.execute(item, parameters)
6771

6872
def versionThree(self):
69-
# Add a new column to the inventory table to store tags.
73+
"""Adding a new column to the inventory table to store tags."""
7074
logger.debug(
7175
'In messages.dat database, adding tag field to'
7276
' the inventory table.')
@@ -78,8 +82,10 @@ def versionThree(self):
7882
self.cur.execute(item, parameters)
7983

8084
def versionFour(self):
81-
# Add a new column to the pubkeys table to store the address version.
82-
# We're going to trash all of our pubkeys and let them be redownloaded.
85+
"""
86+
Add a new column to the pubkeys table to store the address version.
87+
We're going to trash all of our pubkeys and let them be redownloaded.
88+
"""
8389
self.cur.execute('''DROP TABLE pubkeys''')
8490
self.cur.execute(
8591
'''CREATE TABLE pubkeys (hash blob, addressversion int, transmitdata blob, time int,'''
@@ -91,8 +97,10 @@ def versionFour(self):
9197
self.cur.execute(item, parameters)
9298

9399
def versionFive(self):
94-
# Add a new table: objectprocessorqueue with which to hold objects
95-
# that have yet to be processed if the user shuts down Bitmessage.
100+
"""
101+
Add a new table: objectprocessorqueue with which to hold objects
102+
that have yet to be processed if the user shuts down Bitmessage.
103+
"""
96104
self.cur.execute('''DROP TABLE knownnodes''')
97105
self.cur.execute(
98106
'''CREATE TABLE objectprocessorqueue'''
@@ -102,9 +110,11 @@ def versionFive(self):
102110
self.cur.execute(item, parameters)
103111

104112
def versionSix(self):
105-
# changes related to protocol v3
106-
# In table inventory and objectprocessorqueue, objecttype is now
107-
# an integer (it was a human-friendly string previously)
113+
"""
114+
changes related to protocol v3
115+
In table inventory and objectprocessorqueue, objecttype is now
116+
an integer (it was a human-friendly string previously)
117+
"""
108118
logger.debug(
109119
'In messages.dat database, dropping and recreating'
110120
' the inventory table.')
@@ -124,9 +134,11 @@ def versionSix(self):
124134
'Finished dropping and recreating the inventory table.')
125135

126136
def versionSeven(self):
127-
# The format of data stored in the pubkeys table has changed. Let's
128-
# clear it, and the pubkeys from inventory, so that they'll
129-
# be re-downloaded.
137+
"""
138+
The format of data stored in the pubkeys table has changed. Let's
139+
clear it, and the pubkeys from inventory, so that they'll
140+
be re-downloaded.
141+
"""
130142
logger.debug(
131143
'In messages.dat database, clearing pubkeys table'
132144
' because the data format has been updated.')
@@ -144,9 +156,11 @@ def versionSeven(self):
144156
logger.debug('Finished clearing currently held pubkeys.')
145157

146158
def versionEight(self):
147-
# Add a new column to the inbox table to store the hash of
148-
# the message signature. We'll use this as temporary message UUID
149-
# in order to detect duplicates.
159+
"""
160+
Add a new column to the inbox table to store the hash of
161+
the message signature. We'll use this as temporary message UUID
162+
in order to detect duplicates.
163+
"""
150164
logger.debug(
151165
'In messages.dat database, adding sighash field to'
152166
' the inbox table.')
@@ -158,8 +172,10 @@ def versionEight(self):
158172
self.cur.execute(item, parameters)
159173

160174
def versionNine(self):
161-
# We'll also need a `sleeptill` field and a `ttl` field. Also we
162-
# can combine the pubkeyretrynumber and msgretrynumber into one.
175+
"""
176+
We'll also need a `sleeptill` field and a `ttl` field. Also we
177+
can combine the pubkeyretrynumber and msgretrynumber into one.
178+
"""
163179
logger.info(
164180
'In messages.dat database, making TTL-related changes:'
165181
' combining the pubkeyretrynumber and msgretrynumber'
@@ -221,7 +237,7 @@ def versionNine(self):
221237
self.cur.execute('''update settings set value=10 WHERE key='version';''')
222238

223239
def versionTen(self):
224-
# Update the address colunm to unique in addressbook table
240+
"""Update the address colunm to unique in addressbook table"""
225241
logger.debug(
226242
'In messages.dat database, updating address column to UNIQUE'
227243
' in the addressbook table.')

0 commit comments

Comments
 (0)