This commit is contained in:
swedge 2020-10-15 19:35:44 -04:00
parent ec922adb36
commit efaedae801
18 changed files with 36 additions and 36 deletions

View File

@ -24,7 +24,7 @@ from version import softwareVersion # pylint: disable=wrong-import-position
def get_tool_results(file_list): def get_tool_results(file_list):
"""Take a list of files and resuln the results of applying the tools""" """Take a list of files and the results of applying the tools"""
results = [] results = []
for path_to_file in file_list: for path_to_file in file_list:

View File

@ -4,7 +4,7 @@
# pylint: disable=too-many-nested-blocks,too-many-locals,protected-access,too-many-arguments,too-many-function-args # pylint: disable=too-many-nested-blocks,too-many-locals,protected-access,too-many-arguments,too-many-function-args
# pylint: disable=no-member # pylint: disable=no-member
""" """
Created by Adam Melton (.dok) referenceing https://bitmessage.org/wiki/API_Reference for API documentation Created by Adam Melton (.dok) referencing https://bitmessage.org/wiki/API_Reference for API documentation
Distributed under the MIT/X11 software license. See http://www.opensource.org/licenses/mit-license.php. Distributed under the MIT/X11 software license. See http://www.opensource.org/licenses/mit-license.php.
This is an example of a daemon client for PyBitmessage 0.6.2, by .dok (Version 0.3.1) , modified This is an example of a daemon client for PyBitmessage 0.6.2, by .dok (Version 0.3.1) , modified
@ -448,7 +448,7 @@ def subscribe():
def unsubscribe(): def unsubscribe():
"""Unsusbcribe from an address""" """Unsubscribe from an address"""
global usrPrompt global usrPrompt
while True: while True:
@ -623,7 +623,7 @@ def genAdd(lbl, deterministic, passphrase, numOfAdd, addVNum, streamNum, ripe):
def saveFile(fileName, fileData): def saveFile(fileName, fileData):
"""Allows attachments and messages/broadcats to be saved""" """Allows attachments and messages/broadcasts to be saved"""
# This section finds all invalid characters and replaces them with ~ # This section finds all invalid characters and replaces them with ~
fileName = fileName.replace(" ", "") fileName = fileName.replace(" ", "")
@ -1337,7 +1337,7 @@ def markMessageRead(messageID):
def markMessageUnread(messageID): def markMessageUnread(messageID):
"""Mark a mesasge as unread""" """Mark a message as unread"""
global usrPrompt global usrPrompt
@ -1541,7 +1541,7 @@ def UI(usrInput):
usrPrompt = 1 usrPrompt = 1
main() main()
elif usrInput == "subscribe": # Subsribe to an address elif usrInput == "subscribe": # Subscribe to an address
subscribe() subscribe()
usrPrompt = 1 usrPrompt = 1
main() main()

View File

@ -226,7 +226,7 @@ BoxLayout:
text: 'TO' text: 'TO'
color: 0,0,0,1 color: 0,0,0,1
TextInput: TextInput:
id: recipent id: recipient
hint_text: 'To' hint_text: 'To'
BoxLayout: BoxLayout:
@ -348,7 +348,7 @@ BoxLayout:
color: 0,0,0,1 color: 0,0,0,1
<AddressSuccessful>: <AddressSuccessful>:
name: 'add_sucess' name: 'add_success'
Label: Label:
text: 'Successfully created a new bit address' text: 'Successfully created a new bit address'
color: 0,0,0,1 color: 0,0,0,1

View File

@ -157,7 +157,7 @@ class Inbox(Screen):
Clock.schedule_once(self.init_ui, 0) Clock.schedule_once(self.init_ui, 0)
def init_ui(self, dt=0): def init_ui(self, dt=0):
"""Clock Schdule for method inbox accounts.""" """Clock Schedule for method inbox accounts."""
self.inboxaccounts() self.inboxaccounts()
print(dt) print(dt)
@ -208,7 +208,7 @@ class Sent(Screen):
Clock.schedule_once(self.init_ui, 0) Clock.schedule_once(self.init_ui, 0)
def init_ui(self, dt=0): def init_ui(self, dt=0):
"""Clock Schdule for method sent accounts.""" """Clock Schedule for method sent accounts."""
self.sentaccounts() self.sentaccounts()
print(dt) print(dt)
@ -251,7 +251,7 @@ class Trash(Screen):
Clock.schedule_once(self.init_ui, 0) Clock.schedule_once(self.init_ui, 0)
def init_ui(self, dt=0): def init_ui(self, dt=0):
"""Clock Schdule for method inbox accounts.""" """Clock Schedule for method inbox accounts."""
self.inboxaccounts() self.inboxaccounts()
print(dt) print(dt)
@ -303,7 +303,7 @@ class Create(Screen):
def send(self): def send(self):
"""Send message from one address to another.""" """Send message from one address to another."""
fromAddress = self.ids.spinner_id.text fromAddress = self.ids.spinner_id.text
# For now we are using static address i.e we are not using recipent field value. # For now we are using static address i.e we are not using recipient field value.
toAddress = "BM-2cWyUfBdY2FbgyuCb7abFZ49JYxSzUhNFe" toAddress = "BM-2cWyUfBdY2FbgyuCb7abFZ49JYxSzUhNFe"
message = self.ids.message.text message = self.ids.message.text
subject = self.ids.subject.text subject = self.ids.subject.text
@ -350,7 +350,7 @@ class Create(Screen):
self.ids.message.text = '' self.ids.message.text = ''
self.ids.spinner_id.text = '<select>' self.ids.spinner_id.text = '<select>'
self.ids.subject.text = '' self.ids.subject.text = ''
self.ids.recipent.text = '' self.ids.recipient.text = ''
return None return None
def cancel(self): def cancel(self):
@ -358,7 +358,7 @@ class Create(Screen):
self.ids.message.text = '' self.ids.message.text = ''
self.ids.spinner_id.text = '<select>' self.ids.spinner_id.text = '<select>'
self.ids.subject.text = '' self.ids.subject.text = ''
self.ids.recipent.text = '' self.ids.recipient.text = ''
return None return None
@ -386,7 +386,7 @@ class NewIdentity(Screen):
nonceTrialsPerByte, nonceTrialsPerByte,
payloadLengthExtraBytes) payloadLengthExtraBytes)
) )
self.manager.current = 'add_sucess' self.manager.current = 'add_success'
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -1671,7 +1671,7 @@ class MyForm(settingsmixin.SMainWindow):
QtCore.QTimer.singleShot(0, self.appIndicatorHide) QtCore.QTimer.singleShot(0, self.appIndicatorHide)
elif event.oldState() & QtCore.Qt.WindowMinimized: elif event.oldState() & QtCore.Qt.WindowMinimized:
# The window state has just been changed to # The window state has just been changed to
# Normal/Maximised/FullScreen # Normal/Maximized/FullScreen
pass pass
def __icon_activated(self, reason): def __icon_activated(self, reason):

View File

@ -50,7 +50,7 @@ def getSortedSubscriptions(count=False):
:param count: Whether to count messages for each fromaddress in the inbox :param count: Whether to count messages for each fromaddress in the inbox
:type count: bool, default False :type count: bool, default False
:retuns: dict keys are addresses, values are dicts containing settings :returns: dict keys are addresses, values are dicts containing settings
:rtype: dict, default {} :rtype: dict, default {}
""" """
queryreturn = sqlQuery('SELECT label, address, enabled FROM subscriptions ORDER BY label COLLATE NOCASE ASC') queryreturn = sqlQuery('SELECT label, address, enabled FROM subscriptions ORDER BY label COLLATE NOCASE ASC')

View File

@ -599,7 +599,7 @@ class AddressBookCompleter(QtGui.QCompleter):
else: else:
self.cursorPos = self.widget().cursorPosition() self.cursorPos = self.widget().cursorPosition()
# Get current prosition # Get current position
curIndex = self.widget().cursorPosition() curIndex = self.widget().cursorPosition()
# prev_delimiter_index should actually point at final white space # prev_delimiter_index should actually point at final white space

View File

@ -120,7 +120,7 @@ class NewAddressWizardPassphrasePage(QtGui.QWizardPage):
super(QtGui.QWizardPage, self).__init__() super(QtGui.QWizardPage, self).__init__()
self.setTitle("Passphrase") self.setTitle("Passphrase")
label = QtGui.QLabel("Deterministric address.") label = QtGui.QLabel("Deterministic address.")
label.setWordWrap(True) label.setWordWrap(True)
passphraseLabel = QtGui.QLabel("Passphrase") passphraseLabel = QtGui.QLabel("Passphrase")

View File

@ -24,7 +24,7 @@ def identiconize(address):
identicon_lib = BMConfigParser().safeGet( identicon_lib = BMConfigParser().safeGet(
'bitmessagesettings', 'identiconlib', 'qidenticon_two_x') 'bitmessagesettings', 'identiconlib', 'qidenticon_two_x')
# As an 'identiconsuffix' you could put "@bitmessge.ch" or "@bm.addr" # As an 'identiconsuffix' you could put "@bitmessage.ch" or "@bm.addr"
# to make it compatible with other identicon generators. (Note however, # to make it compatible with other identicon generators. (Note however,
# that E-Mail programs might convert the BM-address to lowercase first.) # that E-Mail programs might convert the BM-address to lowercase first.)
# It can be used as a pseudo-password to salt the generation of # It can be used as a pseudo-password to salt the generation of
@ -34,7 +34,7 @@ def identiconize(address):
if identicon_lib[:len('qidenticon')] == 'qidenticon': if identicon_lib[:len('qidenticon')] == 'qidenticon':
# originally by: # originally by:
# :Author:Shin Adachi <shn@glucose.jp> # :Author:Shin Adachi <shn@glucose.jp>
# Licesensed under FreeBSD License. # Licensed under FreeBSD License.
# stripped from PIL and uses QT instead (by sendiulo, same license) # stripped from PIL and uses QT instead (by sendiulo, same license)
import qidenticon import qidenticon
icon_hash = hashlib.md5( icon_hash = hashlib.md5(

View File

@ -160,7 +160,7 @@ class sqlThread(threading.Thread):
self.cur.execute( self.cur.execute(
'''INSERT INTO subscriptions VALUES''' '''INSERT INTO subscriptions VALUES'''
'''('Bitmessage new releases/announcements','BM-GtovgYdgs7qXPkoYaRgrLFuFKz1SFpsw',1)''') '''('Bitmessage new releases/announcements','BM-GtovgYdgs7qXPkoYaRgrLFuFKz1SFpsw',1)''')
logger.debug('Commiting.') logger.debug('Committing.')
self.conn.commit() self.conn.commit()
logger.debug('Vacuuming message.dat. You might notice that the file size gets much smaller.') logger.debug('Vacuuming message.dat. You might notice that the file size gets much smaller.')
self.cur.execute(''' VACUUM ''') self.cur.execute(''' VACUUM ''')
@ -433,7 +433,7 @@ class sqlThread(threading.Thread):
else: else:
logger.error(err) logger.error(err)
# Let us check to see the last time we vaccumed the messages.dat file. # Let us check to see the last time we vacuumed the messages.dat file.
# If it has been more than a month let's do it now. # If it has been more than a month let's do it now.
item = '''SELECT value FROM settings WHERE key='lastvacuumtime';''' item = '''SELECT value FROM settings WHERE key='lastvacuumtime';'''
parameters = '' parameters = ''

View File

@ -1,5 +1,5 @@
""" """
Logging and debuging facility Logging and debugging facility
----------------------------- -----------------------------
Levels: Levels:
@ -46,7 +46,7 @@ import state
helper_startup.loadConfig() helper_startup.loadConfig()
# Now can be overriden from a config file, which uses standard python # Now can be overridden from a config file, which uses standard python
# logging.config.fileConfig interface # logging.config.fileConfig interface
# examples are here: # examples are here:
# https://bitmessage.org/forum/index.php/topic,4820.msg11163.html#msg11163 # https://bitmessage.org/forum/index.php/topic,4820.msg11163.html#msg11163

View File

@ -178,7 +178,7 @@ def check_sqlite():
"""Do sqlite check. """Do sqlite check.
Simply check sqlite3 module if exist or not with hexversion Simply check sqlite3 module if exist or not with hexversion
support in python version for specifieed platform. support in python version for specified platform.
""" """
if sys.hexversion < 0x020500F0: if sys.hexversion < 0x020500F0:
logger.error( logger.error(
@ -224,7 +224,7 @@ def check_sqlite():
return False return False
return True return True
except sqlite3.Error: except sqlite3.Error:
logger.exception('An exception occured while checking sqlite.') logger.exception('An exception occurred while checking sqlite.')
return False return False
finally: finally:
if conn: if conn:
@ -374,12 +374,12 @@ def check_pyqt():
passed = True passed = True
if QtCore.PYQT_VERSION < 0x40800: if QtCore.PYQT_VERSION < 0x40800:
logger.error( logger.error(
'This version of PyQt is too old. PyBitmessage requries' 'This version of PyQt is too old. PyBitmessage requires'
' PyQt 4.8 or later.') ' PyQt 4.8 or later.')
passed = False passed = False
if QtCore.QT_VERSION < 0x40700: if QtCore.QT_VERSION < 0x40700:
logger.error( logger.error(
'This version of Qt is too old. PyBitmessage requries' 'This version of Qt is too old. PyBitmessage requires'
' Qt 4.7 or later.') ' Qt 4.7 or later.')
passed = False passed = False
return passed return passed

View File

@ -71,7 +71,7 @@ def loadConfig():
config.set('bitmessagesettings', 'startonlogon', 'false') config.set('bitmessagesettings', 'startonlogon', 'false')
if 'linux' in sys.platform: if 'linux' in sys.platform:
config.set('bitmessagesettings', 'minimizetotray', 'false') config.set('bitmessagesettings', 'minimizetotray', 'false')
# This isn't implimented yet and when True on # This isn't implemented yet and when True on
# Ubuntu causes Bitmessage to disappear while # Ubuntu causes Bitmessage to disappear while
# running when minimized. # running when minimized.
else: else:

View File

@ -28,7 +28,7 @@ class MDAccordionItem(ThemableBehavior, AccordionItem):
''' Color for title text and icon if `title_theme_color` is Custom ''' ''' Color for title text and icon if `title_theme_color` is Custom '''
background_color = ListProperty(None, allownone=True) background_color = ListProperty(None, allownone=True)
''' Color for the background of the accordian item title in rgba format. ''' Color for the background of the accordion item title in rgba format.
''' '''
divider_color = ListProperty(None, allownone=True) divider_color = ListProperty(None, allownone=True)

View File

@ -100,7 +100,7 @@ def tail(f, lines=20):
f.seek(block_number * BLOCK_SIZE, 2) f.seek(block_number * BLOCK_SIZE, 2)
blocks.append(f.read(BLOCK_SIZE)) blocks.append(f.read(BLOCK_SIZE))
else: else:
# file too small, start from begining # file too small, start from beginning
f.seek(0, 0) f.seek(0, 0)
# only read what was not read # only read what was not read
blocks.append(f.read(block_end_byte)) blocks.append(f.read(block_end_byte))

View File

@ -138,7 +138,7 @@ class DonRenderer(IdenticonRendererBase):
[(0, 0), (4, 0), (4, 4), (0, 4)], [(0, 0), (4, 0), (4, 4), (0, 4)],
# [1] right-angled triangle pointing top-left: # [1] right-angled triangle pointing top-left:
[(0, 0), (4, 0), (0, 4)], [(0, 0), (4, 0), (0, 4)],
# [2] upwardy triangle: # [2] upwardly triangle:
[(2, 0), (4, 4), (0, 4)], [(2, 0), (4, 4), (0, 4)],
# [3] left half of square, standing rectangle: # [3] left half of square, standing rectangle:
[(0, 0), (2, 0), (2, 4), (0, 4)], [(0, 0), (2, 0), (2, 4), (0, 4)],

View File

@ -13,7 +13,7 @@ class TestConfig(unittest.TestCase):
"""A test case for bmconfigparser""" """A test case for bmconfigparser"""
def test_safeGet(self): def test_safeGet(self):
"""safeGet retuns provided default for nonexistent option or None""" """safeGet returns provided default for nonexistent option or None"""
self.assertIs( self.assertIs(
BMConfigParser().safeGet('nonexistent', 'nonexistent'), None) BMConfigParser().safeGet('nonexistent', 'nonexistent'), None)
self.assertEqual( self.assertEqual(
@ -32,7 +32,7 @@ class TestConfig(unittest.TestCase):
'nonexistent', 'nonexistent', True) 'nonexistent', 'nonexistent', True)
def test_safeGetInt(self): def test_safeGetInt(self):
"""safeGetInt retuns provided default for nonexistent option or 0""" """safeGetInt returns provided default for nonexistent option or 0"""
self.assertEqual( self.assertEqual(
BMConfigParser().safeGetInt('nonexistent', 'nonexistent'), 0) BMConfigParser().safeGetInt('nonexistent', 'nonexistent'), 0)
self.assertEqual( self.assertEqual(

View File

@ -80,7 +80,7 @@ class UPnPError(Exception):
class Router: # pylint: disable=old-style-class class Router: # pylint: disable=old-style-class
"""Encapulate routing""" """Encapsulate routing"""
name = "" name = ""
path = "" path = ""
address = None address = None