Initial commit for test cases python3 porting
|
@ -1,6 +1,6 @@
|
|||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
- "3.7"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
|
|
@ -36,6 +36,9 @@ COMPILING = {
|
|||
"openSUSE": "gcc-c++ libopenssl-devel python-devel",
|
||||
"optional": False,
|
||||
}
|
||||
print('************************************')
|
||||
print('inside the checkdeps')
|
||||
print('************************************')
|
||||
|
||||
# OS-specific dependencies for optional components listed in EXTRAS_REQUIRE
|
||||
EXTRAS_REQUIRE_DEPS = {
|
||||
|
|
|
@ -14,7 +14,6 @@ For help on fabric itself:
|
|||
|
||||
For more help on a particular command
|
||||
"""
|
||||
|
||||
from fabric.api import env
|
||||
|
||||
from fabfile.tasks import code_quality, build_docs, push_docs, clean, test
|
||||
|
|
|
@ -46,13 +46,13 @@ def print_results(results, top, verbose, details):
|
|||
"""Print an item with the appropriate verbosity / detail"""
|
||||
|
||||
if verbose and results:
|
||||
print ''.join(
|
||||
print( ''.join(
|
||||
[
|
||||
os.linesep,
|
||||
'total pycodestyle flake8 pylint path_to_file',
|
||||
os.linesep,
|
||||
]
|
||||
)
|
||||
))
|
||||
|
||||
for item in sort_and_slice(results, top):
|
||||
|
||||
|
@ -66,23 +66,23 @@ def print_results(results, top, verbose, details):
|
|||
)
|
||||
else:
|
||||
line = item['path_to_file']
|
||||
print line
|
||||
print (line)
|
||||
|
||||
if details:
|
||||
print "pycodestyle:"
|
||||
print ("pycodestyle:")
|
||||
for detail in flatten(item['pycodestyle_violations']):
|
||||
print detail
|
||||
print
|
||||
print (detail)
|
||||
print()
|
||||
|
||||
print "flake8:"
|
||||
print ("flake8:")
|
||||
for detail in flatten(item['flake8_violations']):
|
||||
print detail
|
||||
print
|
||||
print (detail)
|
||||
print()
|
||||
|
||||
print "pylint:"
|
||||
print ("pylint:")
|
||||
for detail in flatten(item['pylint_violations']):
|
||||
print detail
|
||||
print
|
||||
print (detail)
|
||||
print()
|
||||
|
||||
|
||||
def sort_and_slice(results, top):
|
||||
|
@ -107,7 +107,7 @@ def generate_file_list(filename):
|
|||
if filename:
|
||||
filename = os.path.abspath(filename)
|
||||
if not os.path.exists(filename):
|
||||
print "Bad filename, specify a Python file"
|
||||
print("Bad filename, specify a Python file")
|
||||
sys.exit(1)
|
||||
else:
|
||||
file_list = [filename]
|
||||
|
@ -303,7 +303,7 @@ def push_docs(path=None):
|
|||
)
|
||||
result = run('ln -sf {0} {1}'.format(WEB_ROOT, VERSION_ROOT))
|
||||
if result.return_code:
|
||||
print 'Linking the new release failed'
|
||||
print('Linking the new release failed')
|
||||
|
||||
# More assumptions
|
||||
sudo('systemctl restart apache2')
|
||||
|
|
BIN
images/kivy/paymode/111.webp
Executable file
After Width: | Height: | Size: 11 KiB |
BIN
images/kivy/paymode/bitcoin-logo.jpg
Executable file
After Width: | Height: | Size: 8.3 KiB |
BIN
images/kivy/paymode/download.png
Executable file
After Width: | Height: | Size: 5.5 KiB |
|
@ -1,3 +1,11 @@
|
|||
python_prctl
|
||||
psutil
|
||||
pycrypto
|
||||
qrcode
|
||||
Fabric3
|
||||
fabric-virtualenv
|
||||
httplib2
|
||||
urllib3
|
||||
pythondialog
|
||||
stem
|
||||
Pillow
|
28
setup.py
Normal file → Executable file
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from setuptools import setup, Extension
|
||||
from setuptools.command.install import install
|
||||
|
@ -17,9 +18,21 @@ EXTRAS_REQUIRE = {
|
|||
'qrcode': ['qrcode'],
|
||||
'sound;platform_system=="Windows"': ['winsound'],
|
||||
'tor': ['stem'],
|
||||
'docs': ['sphinx', 'sphinxcontrib-apidoc', 'm2r']
|
||||
'docs': ['sphinx', 'sphinxcontrib-apidoc', 'm2r'],
|
||||
'qrcode':['qrcode']
|
||||
}
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
version_dependencies = {
|
||||
'requirements_file' : 'requirements2.txt',
|
||||
'pybitmessage_file' : 'src/pybitmessage2'
|
||||
}
|
||||
else:
|
||||
version_dependencies = {
|
||||
'requirements_file' : 'requirements.txt',
|
||||
'pybitmessage_file' : 'src/pybitmessage'
|
||||
}
|
||||
|
||||
|
||||
class InstallCmd(install):
|
||||
def run(self):
|
||||
|
@ -45,7 +58,7 @@ if __name__ == "__main__":
|
|||
with open(os.path.join(here, 'README.md')) as f:
|
||||
README = f.read()
|
||||
|
||||
with open(os.path.join(here, 'requirements.txt'), 'r') as f:
|
||||
with open(os.path.join(here, version_dependencies['requirements_file']), 'r') as f:
|
||||
requirements = list(f.readlines())
|
||||
|
||||
bitmsghash = Extension(
|
||||
|
@ -57,8 +70,8 @@ if __name__ == "__main__":
|
|||
installRequires = []
|
||||
packages = [
|
||||
'pybitmessage',
|
||||
'pybitmessage.bitmessageqt',
|
||||
'pybitmessage.bitmessagecurses',
|
||||
# 'pybitmessage.bitmessageqt',
|
||||
# 'pybitmessage.bitmessagecurses',
|
||||
'pybitmessage.fallback',
|
||||
'pybitmessage.messagetypes',
|
||||
'pybitmessage.network',
|
||||
|
@ -69,6 +82,7 @@ if __name__ == "__main__":
|
|||
|
||||
# this will silently accept alternative providers of msgpack
|
||||
# if they are already installed
|
||||
|
||||
|
||||
try:
|
||||
import msgpack
|
||||
|
@ -95,7 +109,7 @@ if __name__ == "__main__":
|
|||
# TODO: add keywords
|
||||
#keywords='',
|
||||
install_requires=installRequires,
|
||||
tests_require=requirements,
|
||||
tests_require=requirements,
|
||||
extras_require=EXTRAS_REQUIRE,
|
||||
classifiers=[
|
||||
"License :: OSI Approved :: MIT License"
|
||||
|
@ -108,7 +122,7 @@ if __name__ == "__main__":
|
|||
package_dir={'pybitmessage': 'src'},
|
||||
packages=packages,
|
||||
package_data={'': [
|
||||
'bitmessageqt/*.ui', 'bitmsghash/*.cl', 'sslkeys/*.pem',
|
||||
'sslkeys/*.pem',
|
||||
'translations/*.ts', 'translations/*.qm',
|
||||
'images/*.png', 'images/*.ico', 'images/*.icns'
|
||||
]},
|
||||
|
@ -148,7 +162,7 @@ if __name__ == "__main__":
|
|||
# 'pybitmessage = pybitmessage.bitmessagemain:main'
|
||||
# ]
|
||||
},
|
||||
scripts=['src/pybitmessage'],
|
||||
scripts=[version_dependencies['pybitmessage_file']],
|
||||
cmdclass={'install': InstallCmd},
|
||||
command_options={
|
||||
'build_sphinx': {
|
||||
|
|
0
src/__init__.py
Normal file → Executable file
6
src/addresses.py
Normal file → Executable file
|
@ -5,8 +5,10 @@ Operations with addresses
|
|||
import hashlib
|
||||
from binascii import hexlify, unhexlify
|
||||
from struct import pack, unpack
|
||||
|
||||
from debug import logger
|
||||
try:
|
||||
from debug import logger
|
||||
except ModuleNotFoundError:
|
||||
from .debug import logger
|
||||
|
||||
ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
||||
|
||||
|
|
0
src/alice.png
Normal file → Executable file
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 669 B |
89
src/api.py
Normal file → Executable file
|
@ -15,35 +15,60 @@ import socket
|
|||
import subprocess
|
||||
import time
|
||||
from binascii import hexlify, unhexlify
|
||||
from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler, \
|
||||
SimpleXMLRPCServer
|
||||
|
||||
from xmlrpc.server import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
|
||||
from struct import pack
|
||||
|
||||
import defaults
|
||||
import helper_inbox
|
||||
import helper_sent
|
||||
import network.stats
|
||||
import proofofwork
|
||||
import queues
|
||||
import shared
|
||||
import shutdown
|
||||
import state
|
||||
import threads
|
||||
from addresses import (
|
||||
addBMIfNotPresent,
|
||||
calculateInventoryHash,
|
||||
decodeAddress,
|
||||
decodeVarint,
|
||||
varintDecodeError
|
||||
)
|
||||
from bmconfigparser import BMConfigParser
|
||||
from debug import logger
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
|
||||
from inventory import Inventory
|
||||
from network.threads import StoppableThread
|
||||
from version import softwareVersion
|
||||
|
||||
try:
|
||||
import defaults
|
||||
import helper_inbox
|
||||
import helper_sent
|
||||
import network.stats
|
||||
import proofofwork
|
||||
import queues
|
||||
import shared
|
||||
import shutdown
|
||||
import state
|
||||
from addresses import (
|
||||
addBMIfNotPresent,
|
||||
calculateInventoryHash,
|
||||
decodeAddress,
|
||||
decodeVarint,
|
||||
varintDecodeError
|
||||
)
|
||||
from bmconfigparser import BMConfigParser
|
||||
from debug import logger
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
|
||||
from inventory import Inventory
|
||||
from network.threads import StoppableThread
|
||||
from version import softwareVersion
|
||||
except:
|
||||
from . import defaults
|
||||
from . import helper_inbox
|
||||
from . import helper_sent
|
||||
from .network import stats
|
||||
from . import proofofwork
|
||||
from . import queues
|
||||
from . import shared
|
||||
from .import shutdown
|
||||
from .import state
|
||||
from .addresses import (
|
||||
addBMIfNotPresent,
|
||||
calculateInventoryHash,
|
||||
decodeAddress,
|
||||
decodeVarint,
|
||||
varintDecodeError
|
||||
)
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .debug import logger
|
||||
from .helper_ackPayload import genAckPayload
|
||||
from .helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
|
||||
from .inventory import Inventory
|
||||
from .network.threads import StoppableThread
|
||||
from .version import softwareVersion
|
||||
|
||||
str_chan = '[chan]'
|
||||
|
||||
|
||||
|
@ -1227,7 +1252,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
|||
initialHash = hashlib.sha512(encryptedPayload).digest()
|
||||
trialValue, nonce = proofofwork.run(target, initialHash)
|
||||
with threads.printLock:
|
||||
print('(For msg message via API) Found proof of work', trialValue, 'Nonce:', nonce)
|
||||
print('(For msg message via API) Found proof of work {}, Nonce: {})'.\
|
||||
format(trialValue,nonce))
|
||||
try:
|
||||
print(
|
||||
'POW took', int(time.time() - powStartTime),
|
||||
|
@ -1246,7 +1272,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
|||
int(time.time()) + TTL, ''
|
||||
)
|
||||
with threads.printLock:
|
||||
print('Broadcasting inv for msg(API disseminatePreEncryptedMsg command):', hexlify(inventoryHash))
|
||||
print('Broadcasting inv for msg(API disseminatePreEncryptedMsg command): {}'.\
|
||||
format(hexlify(inventoryHash)))
|
||||
queues.invQueue.put((toStreamNumber, inventoryHash))
|
||||
|
||||
def HandleTrashSentMessageByAckDAta(self, params):
|
||||
|
@ -1279,7 +1306,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
|||
print('(For pubkey message via API) Doing proof of work...')
|
||||
initialHash = hashlib.sha512(payload).digest()
|
||||
trialValue, nonce = proofofwork.run(target, initialHash)
|
||||
print('(For pubkey message via API) Found proof of work', trialValue, 'Nonce:', nonce)
|
||||
print('(For pubkey message via API) Found proof of work {} ,Nonce: {}'.\
|
||||
format(trialValue,nonce))
|
||||
payload = pack('>Q', nonce) + payload
|
||||
|
||||
pubkeyReadPosition = 8 # bypass the nonce
|
||||
|
@ -1300,7 +1328,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
|||
objectType, pubkeyStreamNumber, payload, int(time.time()) + TTL, ''
|
||||
)
|
||||
with threads.printLock:
|
||||
print('broadcasting inv within API command disseminatePubkey with hash:', hexlify(inventoryHash))
|
||||
print('broadcasting inv within API command disseminatePubkey with hash:{}'.\
|
||||
format(hexlify(inventoryHash)))
|
||||
queues.invQueue.put((pubkeyStreamNumber, inventoryHash))
|
||||
|
||||
def HandleGetMessageDataByDestinationHash(self, params):
|
||||
|
|
8
src/bitmessagecli.py
Normal file → Executable file
|
@ -21,10 +21,12 @@ import os
|
|||
import socket
|
||||
import sys
|
||||
import time
|
||||
import xmlrpclib
|
||||
|
||||
from bmconfigparser import BMConfigParser
|
||||
import xmlrpc.client as xmlrpclib
|
||||
|
||||
try:
|
||||
from bmconfigparser import BMConfigParser
|
||||
except:
|
||||
from .bmconfigparser import BMConfigParser
|
||||
|
||||
api = ''
|
||||
keysName = 'keys.dat'
|
||||
|
|
40
src/bitmessagecurses/__init__.py
Normal file → Executable file
|
@ -10,27 +10,41 @@ Bitmessage commandline interface
|
|||
# * python2-pythondialog
|
||||
# * dialog
|
||||
|
||||
import ConfigParser
|
||||
import configparser as ConfigParser
|
||||
import curses
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from textwrap import fill
|
||||
from threading import Timer
|
||||
|
||||
from dialog import Dialog
|
||||
import l10n
|
||||
import network.stats
|
||||
import queues
|
||||
import shared
|
||||
import shutdown
|
||||
import state
|
||||
|
||||
from addresses import addBMIfNotPresent, decodeAddress
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
try:
|
||||
from dialog import Dialog
|
||||
import l10n
|
||||
import network.stats
|
||||
import queues
|
||||
import shared
|
||||
import shutdown
|
||||
|
||||
from addresses import addBMIfNotPresent, decodeAddress
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
except ModuleNotFoundError:
|
||||
from .. import l10n
|
||||
from ..network import stats
|
||||
from .. import queues
|
||||
from .. import shared
|
||||
from .. import shutdown
|
||||
|
||||
from ..addresses import addBMIfNotPresent, decodeAddress
|
||||
from ..bmconfigparser import BMConfigParser
|
||||
from ..helper_ackPayload import genAckPayload
|
||||
from ..helper_sql import sqlExecute, sqlQuery
|
||||
from ..inventory import Inventory
|
||||
|
||||
# pylint: disable=global-statement
|
||||
|
||||
|
||||
|
|
0
src/bitmessagekivy/__init__.py
Normal file → Executable file
0
src/bitmessagekivy/android/python-for-android/recipes/bitmsghash/__init__.py
Normal file → Executable file
0
src/bitmessagekivy/identiconGeneration.py
Normal file → Executable file
6
src/bitmessagekivy/kivy_helper_search.py
Normal file → Executable file
|
@ -1,8 +1,10 @@
|
|||
"""
|
||||
Sql queries for bitmessagekivy
|
||||
"""
|
||||
from helper_sql import sqlQuery
|
||||
|
||||
try:
|
||||
from helper_sql import sqlQuery
|
||||
except ModuleNotFoundError:
|
||||
from ..helper_sql import sqlQuery
|
||||
|
||||
def search_sql(
|
||||
xAddress="toaddress", account=None, folder="inbox", where=None,
|
||||
|
|
0
src/bitmessagekivy/kv/addressbook.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/allmails.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/chat_list.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/chat_room.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/common_widgets.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/composer.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/credits.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/draft.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/inbox.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/login.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/maildetail.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/myaddress.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/network.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/payment.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/popup.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/sent.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/settings.kv
Normal file → Executable file
0
src/bitmessagekivy/kv/trash.kv
Normal file → Executable file
0
src/bitmessagekivy/main.kv
Normal file → Executable file
32
src/bitmessagekivy/mpybit.py
Normal file → Executable file
|
@ -13,12 +13,19 @@ Bitmessage android(mobile) interface
|
|||
from bitmessagekivy.get_platform import platform
|
||||
import os
|
||||
import time
|
||||
from bitmessagekivy import identiconGeneration
|
||||
from bitmessagekivy import kivy_helper_search
|
||||
from bitmessagekivy.uikivysignaler import UIkivySignaler
|
||||
from bmconfigparser import BMConfigParser
|
||||
from functools import partial
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
try:
|
||||
from bitmessagekivy import identiconGeneration
|
||||
from bitmessagekivy import kivy_helper_search
|
||||
from bitmessagekivy.uikivysignaler import UIkivySignaler
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
except ModuleNotFoundError:
|
||||
from ..bitmessagekivy import identiconGeneration
|
||||
from ..bitmessagekivy import kivy_helper_search
|
||||
from ..bitmessagekivy.uikivysignaler import UIkivySignaler
|
||||
from ..bmconfigparser import BMConfigParser
|
||||
from ..helper_sql import sqlExecute, sqlQuery
|
||||
from kivymd.app import MDApp
|
||||
from kivy.clock import Clock
|
||||
from kivy.core.clipboard import Clipboard
|
||||
|
@ -68,11 +75,18 @@ from kivymd.uix.selectioncontrol import MDCheckbox, MDSwitch
|
|||
from kivymd.uix.chip import MDChip
|
||||
from kivy.uix.screenmanager import RiseInTransition, SlideTransition, FallOutTransition
|
||||
|
||||
import queues
|
||||
from semaphores import kivyuisignaler
|
||||
try:
|
||||
import queues
|
||||
from semaphores import kivyuisignaler
|
||||
import state
|
||||
from addresses import decodeAddress
|
||||
except ModuleNotFoundError:
|
||||
from .. import queues
|
||||
from ..semaphores import kivyuisignaler
|
||||
from .. import state
|
||||
from ..addresses import decodeAddress
|
||||
|
||||
|
||||
import state
|
||||
from addresses import decodeAddress
|
||||
from datetime import datetime
|
||||
from kivymd.uix.behaviors.elevation import RectangularElevationBehavior
|
||||
from kivymd.uix.bottomsheet import MDCustomBottomSheet
|
||||
|
|
12
src/bitmessagekivy/uikivysignaler.py
Normal file → Executable file
|
@ -3,10 +3,14 @@ Ui Singnaler for kivy interface
|
|||
"""
|
||||
from threading import Thread
|
||||
|
||||
import queues
|
||||
import state
|
||||
from semaphores import kivyuisignaler
|
||||
|
||||
try:
|
||||
import queues
|
||||
import state
|
||||
from semaphores import kivyuisignaler
|
||||
except ModuleNotFoundError:
|
||||
from .. import queues
|
||||
from .. import state
|
||||
from ..semaphores import kivyuisignaler
|
||||
|
||||
class UIkivySignaler(Thread):
|
||||
"""Kivy ui signaler"""
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python2.7
|
||||
#!/usr/local/bin/python3.7
|
||||
"""
|
||||
The PyBitmessage startup script
|
||||
"""
|
||||
|
@ -22,29 +22,57 @@ import time
|
|||
import traceback
|
||||
from struct import pack
|
||||
|
||||
import defaults
|
||||
import depends
|
||||
import shared
|
||||
import shutdown
|
||||
import state
|
||||
try:
|
||||
import defaults
|
||||
import depends
|
||||
import shared
|
||||
import shutdown
|
||||
import state
|
||||
from bmconfigparser import BMConfigParser
|
||||
# this should go before any threads
|
||||
from debug import logger
|
||||
from helper_startup import (
|
||||
adjustHalfOpenConnectionsLimit,
|
||||
start_proxyconfig
|
||||
)
|
||||
from inventory import Inventory
|
||||
from knownnodes import readKnownNodes
|
||||
# Network objects and threads
|
||||
from network import (
|
||||
BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread,
|
||||
InvThread, ReceiveQueueThread, DownloadThread, UploadThread
|
||||
)
|
||||
from singleinstance import singleinstance
|
||||
# Synchronous threads
|
||||
from threads import (set_thread_name, printLock,
|
||||
addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread)
|
||||
|
||||
except ModuleNotFoundError:
|
||||
from pybitmessage import defaults
|
||||
from pybitmessage import depends
|
||||
from pybitmessage import shared
|
||||
from pybitmessage import shutdown
|
||||
from pybitmessage import state
|
||||
|
||||
from bmconfigparser import BMConfigParser
|
||||
# this should go before any threads
|
||||
from debug import logger
|
||||
from helper_startup import (
|
||||
adjustHalfOpenConnectionsLimit, start_proxyconfig)
|
||||
from inventory import Inventory
|
||||
from knownnodes import readKnownNodes
|
||||
# Network objects and threads
|
||||
from network import (
|
||||
BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread,
|
||||
InvThread, ReceiveQueueThread, DownloadThread, UploadThread
|
||||
)
|
||||
from singleinstance import singleinstance
|
||||
# Synchronous threads
|
||||
from threads import (
|
||||
set_thread_name, printLock,
|
||||
addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread)
|
||||
from pybitmessage.bmconfigparser import BMConfigParser
|
||||
# this should go before any threads
|
||||
from pybitmessage.debug import logger
|
||||
from pybitmessage.helper_startup import (
|
||||
adjustHalfOpenConnectionsLimit,
|
||||
start_proxyconfig
|
||||
)
|
||||
from pybitmessage.inventory import Inventory
|
||||
from pybitmessage.knownnodes import readKnownNodes
|
||||
# Network objects and threads
|
||||
from pybitmessage.network import (
|
||||
BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread,
|
||||
InvThread, ReceiveQueueThread, DownloadThread, UploadThread
|
||||
)
|
||||
from pybitmessage.singleinstance import singleinstance
|
||||
# Synchronous threads
|
||||
from pybitmessage.threads import (set_thread_name, printLock,
|
||||
addressGenerator, objectProcessor, singleCleaner,
|
||||
singleWorker, sqlThread)
|
||||
|
||||
app_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
os.chdir(app_dir)
|
||||
|
@ -353,8 +381,9 @@ class Main(object):
|
|||
state.kivyapp = NavigateApp()
|
||||
state.kivyapp.run()
|
||||
else:
|
||||
import bitmessageqt
|
||||
bitmessageqt.run()
|
||||
pass
|
||||
# import bitmessageqt
|
||||
# bitmessageqt.run()
|
||||
else:
|
||||
config.remove_option('bitmessagesettings', 'dontconnect')
|
||||
|
||||
|
|
104
src/bitmessageqt/__init__.py
Normal file → Executable file
|
@ -17,41 +17,75 @@ from sqlite3 import register_adapter
|
|||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.QtNetwork import QLocalSocket, QLocalServer
|
||||
|
||||
import shared
|
||||
import state
|
||||
from debug import logger
|
||||
from tr import _translate
|
||||
from addresses import decodeAddress, addBMIfNotPresent
|
||||
from bitmessageui import Ui_MainWindow
|
||||
from bmconfigparser import BMConfigParser
|
||||
import namecoin
|
||||
from messageview import MessageView
|
||||
from migrationwizard import Ui_MigrationWizard
|
||||
from foldertree import (
|
||||
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
|
||||
MessageList_AddressWidget, MessageList_SubjectWidget,
|
||||
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress,
|
||||
MessageList_TimeWidget)
|
||||
import settingsmixin
|
||||
import support
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
|
||||
import helper_search
|
||||
import l10n
|
||||
from utils import str_broadcast_subscribers, avatarize
|
||||
from account import (
|
||||
getSortedAccounts, getSortedSubscriptions, accountClass, BMAccount,
|
||||
GatewayAccount, MailchuckAccount, AccountColor)
|
||||
import dialogs
|
||||
from network.stats import pendingDownload, pendingUpload
|
||||
from uisignaler import UISignaler
|
||||
import paths
|
||||
from proofofwork import getPowType
|
||||
import queues
|
||||
import shutdown
|
||||
from statusbar import BMStatusBar
|
||||
import sound
|
||||
try:
|
||||
import shared
|
||||
import state
|
||||
from debug import logger
|
||||
from tr import _translate
|
||||
from addresses import decodeAddress, addBMIfNotPresent
|
||||
from bitmessageui import Ui_MainWindow
|
||||
from bmconfigparser import BMConfigParser
|
||||
import namecoin
|
||||
from messageview import MessageView
|
||||
from migrationwizard import Ui_MigrationWizard
|
||||
from foldertree import (
|
||||
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
|
||||
MessageList_AddressWidget, MessageList_SubjectWidget,
|
||||
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress,
|
||||
MessageList_TimeWidget)
|
||||
import settingsmixin
|
||||
import support
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
|
||||
import helper_search
|
||||
import l10n
|
||||
from utils import str_broadcast_subscribers, avatarize
|
||||
from account import (
|
||||
getSortedAccounts, getSortedSubscriptions, accountClass, BMAccount,
|
||||
GatewayAccount, MailchuckAccount, AccountColor)
|
||||
import dialogs
|
||||
from network.stats import pendingDownload, pendingUpload
|
||||
from uisignaler import UISignaler
|
||||
import paths
|
||||
from proofofwork import getPowType
|
||||
import queues
|
||||
import shutdown
|
||||
from statusbar import BMStatusBar
|
||||
import sound
|
||||
except Exception:
|
||||
from ..debug import logger
|
||||
from ..tr import _translate
|
||||
from ..addresses import decodeAddress, addBMIfNotPresent
|
||||
from .. import shared
|
||||
from .bitmessageui import Ui_MainWindow
|
||||
from ..bmconfigparser import BMConfigParser
|
||||
from .. import namecoin
|
||||
from .messageview import MessageView
|
||||
from .migrationwizard import Ui_MigrationWizard
|
||||
from .foldertree import (
|
||||
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
|
||||
MessageList_AddressWidget, MessageList_SubjectWidget,
|
||||
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress)
|
||||
from . import settingsmixin
|
||||
from . import support
|
||||
from ..helper_ackPayload import genAckPayload
|
||||
from ..helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
|
||||
from .. import helper_search
|
||||
from .. import l10n
|
||||
from .utils import str_broadcast_subscribers, avatarize
|
||||
from .account import (
|
||||
getSortedAccounts, getSortedSubscriptions, accountClass, BMAccount,
|
||||
GatewayAccount, MailchuckAccount, AccountColor)
|
||||
from . import dialogs
|
||||
from ..network.stats import pendingDownload, pendingUpload
|
||||
from .uisignaler import UISignaler
|
||||
from .. import paths
|
||||
from ..proofofwork import getPowType
|
||||
from .. import queues
|
||||
from .. import shutdown
|
||||
from .. import state
|
||||
from .statusbar import BMStatusBar
|
||||
from . import sound
|
||||
# This is needed for tray icon
|
||||
import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
|
||||
|
||||
|
|
0
src/bitmessageqt/about.ui
Normal file → Executable file
0
src/bitmessageqt/account.py
Normal file → Executable file
0
src/bitmessageqt/addaddressdialog.ui
Normal file → Executable file
0
src/bitmessageqt/addpeer.ui
Normal file → Executable file
0
src/bitmessageqt/address_dialogs.py
Normal file → Executable file
0
src/bitmessageqt/addressvalidator.py
Normal file → Executable file
0
src/bitmessageqt/bitmessage_icons.qrc
Normal file → Executable file
0
src/bitmessageqt/bitmessage_icons_rc.py
Normal file → Executable file
0
src/bitmessageqt/bitmessageui.py
Normal file → Executable file
0
src/bitmessageqt/bitmessageui.ui
Normal file → Executable file
0
src/bitmessageqt/blacklist.py
Normal file → Executable file
0
src/bitmessageqt/blacklist.ui
Normal file → Executable file
0
src/bitmessageqt/connect.ui
Normal file → Executable file
0
src/bitmessageqt/dialogs.py
Normal file → Executable file
0
src/bitmessageqt/emailgateway.ui
Normal file → Executable file
0
src/bitmessageqt/foldertree.py
Normal file → Executable file
0
src/bitmessageqt/help.ui
Normal file → Executable file
0
src/bitmessageqt/iconglossary.ui
Normal file → Executable file
0
src/bitmessageqt/languagebox.py
Normal file → Executable file
0
src/bitmessageqt/messagecompose.py
Normal file → Executable file
0
src/bitmessageqt/messageview.py
Normal file → Executable file
0
src/bitmessageqt/migrationwizard.py
Normal file → Executable file
0
src/bitmessageqt/networkstatus.py
Normal file → Executable file
0
src/bitmessageqt/networkstatus.ui
Normal file → Executable file
0
src/bitmessageqt/newaddressdialog.ui
Normal file → Executable file
0
src/bitmessageqt/newaddresswizard.py
Normal file → Executable file
0
src/bitmessageqt/newchandialog.py
Normal file → Executable file
0
src/bitmessageqt/newchandialog.ui
Normal file → Executable file
0
src/bitmessageqt/newsubscriptiondialog.ui
Normal file → Executable file
0
src/bitmessageqt/regenerateaddresses.ui
Normal file → Executable file
0
src/bitmessageqt/retranslateui.py
Normal file → Executable file
0
src/bitmessageqt/safehtmlparser.py
Normal file → Executable file
36
src/bitmessageqt/settings.py
Normal file → Executable file
|
@ -23,7 +23,41 @@ from helper_startup import start_proxyconfig
|
|||
from network.asyncore_pollchoose import set_rates
|
||||
from tr import _translate
|
||||
|
||||
|
||||
try:
|
||||
import debug
|
||||
import defaults
|
||||
import knownnodes
|
||||
import namecoin
|
||||
import openclpow
|
||||
import paths
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tempfile
|
||||
import widgets
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlStoredProcedure
|
||||
from helper_startup import start_proxyconfig
|
||||
from network.asyncore_pollchoose import set_rates
|
||||
from tr import _translate
|
||||
except:
|
||||
from .. import debug
|
||||
from .. import defaults
|
||||
from .. import knownnodes
|
||||
from .. import namecoin
|
||||
from .. import openclpow
|
||||
from .. import paths
|
||||
from .. import queues
|
||||
from .. import shared
|
||||
from .. import state
|
||||
# from .. import tempfile
|
||||
# import widgets
|
||||
from ..bmconfigparser import BMConfigParser
|
||||
from ..helper_sql import sqlExecute, sqlStoredProcedure
|
||||
from ..helper_startup import start_proxyconfig
|
||||
from ..network.asyncore_pollchoose import set_rates
|
||||
from ..tr import _translate
|
||||
|
||||
def getSOCKSProxyType(config):
|
||||
"""Get user socksproxytype setting from *config*"""
|
||||
try:
|
||||
|
|
0
src/bitmessageqt/settings.ui
Normal file → Executable file
0
src/bitmessageqt/settingsmixin.py
Normal file → Executable file
0
src/bitmessageqt/sound.py
Normal file → Executable file
0
src/bitmessageqt/specialaddressbehavior.ui
Normal file → Executable file
0
src/bitmessageqt/statusbar.py
Normal file → Executable file
52
src/bitmessageqt/support.py
Normal file → Executable file
|
@ -8,23 +8,41 @@ import time
|
|||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
import account
|
||||
import defaults
|
||||
import network.stats
|
||||
import paths
|
||||
import proofofwork
|
||||
import queues
|
||||
import state
|
||||
from bmconfigparser import BMConfigParser
|
||||
from foldertree import AccountMixin
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from l10n import getTranslationLanguage
|
||||
from openclpow import openclEnabled
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
from settings import getSOCKSProxyType
|
||||
from version import softwareVersion
|
||||
from tr import _translate
|
||||
|
||||
try:
|
||||
import account
|
||||
from bmconfigparser import BMConfigParser
|
||||
from debug import logger
|
||||
import defaults
|
||||
from foldertree import AccountMixin
|
||||
from helper_sql import *
|
||||
from l10n import getTranslationLanguage
|
||||
from openclpow import openclAvailable, openclEnabled
|
||||
import paths
|
||||
import proofofwork
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
from settings import getSOCKSProxyType
|
||||
import queues
|
||||
import network.stats
|
||||
import state
|
||||
from version import softwareVersion
|
||||
except:
|
||||
|
||||
from .. import account
|
||||
from ..bmconfigparser import BMConfigParser
|
||||
from ..debug import logger
|
||||
from .. import defaults
|
||||
# from ..foldertree import AccountMixin
|
||||
from ..helper_sql import *
|
||||
from ..l10n import getTranslationLanguage
|
||||
from ..openclpow import openclAvailable, openclEnabled
|
||||
from .. import paths
|
||||
from .. import proofofwork
|
||||
from ..pyelliptic.openssl import OpenSSL
|
||||
from .settings import getSOCKSProxyType
|
||||
from .. import queues
|
||||
from ..network import stats
|
||||
from .. import state
|
||||
from ..version import softwareVersion
|
||||
|
||||
# this is BM support address going to Peter Surda
|
||||
OLD_SUPPORT_ADDRESS = 'BM-2cTkCtMYkrSPwFTpgcBrMrf5d8oZwvMZWK'
|
||||
|
|
0
src/bitmessageqt/uisignaler.py
Normal file → Executable file
0
src/bitmessageqt/utils.py
Normal file → Executable file
0
src/bitmessageqt/wanlan.ui
Normal file → Executable file
0
src/bitmessageqt/widgets.py
Normal file → Executable file
0
src/bitmsghash/Makefile
Normal file → Executable file
0
src/bitmsghash/Makefile.bsd
Normal file → Executable file
0
src/bitmsghash/Makefile.msvc
Normal file → Executable file
0
src/bitmsghash/bitmsghash.cl
Normal file → Executable file
0
src/bitmsghash/bitmsghash.cpp
Normal file → Executable file
9
src/bmconfigparser.py
Normal file → Executable file
|
@ -7,8 +7,13 @@ import os
|
|||
import shutil
|
||||
from datetime import datetime
|
||||
|
||||
import state
|
||||
from singleton import Singleton
|
||||
try:
|
||||
import state
|
||||
from singleton import Singleton
|
||||
except ModuleNotFoundError:
|
||||
from . import state
|
||||
from .singleton import Singleton
|
||||
|
||||
|
||||
BMConfigDefaults = {
|
||||
"bitmessagesettings": {
|
||||
|
|
0
src/bob.png
Normal file → Executable file
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 640 B |
0
src/build_osx.py
Normal file → Executable file
0
src/buildozer.spec
Normal file → Executable file
40
src/class_addressGenerator.py
Normal file → Executable file
|
@ -4,20 +4,32 @@ A thread for creating addresses
|
|||
import hashlib
|
||||
import time
|
||||
from binascii import hexlify
|
||||
|
||||
import defaults
|
||||
import highlevelcrypto
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import decodeAddress, encodeAddress, encodeVarint
|
||||
from bmconfigparser import BMConfigParser
|
||||
from fallback import RIPEMD160Hash
|
||||
from pyelliptic import arithmetic
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
from network.threads import StoppableThread
|
||||
|
||||
try:
|
||||
import defaults
|
||||
import highlevelcrypto
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import decodeAddress, encodeAddress, encodeVarint
|
||||
from bmconfigparser import BMConfigParser
|
||||
from fallback import RIPEMD160Hash
|
||||
from pyelliptic import arithmetic
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
from network.threads import StoppableThread
|
||||
except ModuleNotFoundError:
|
||||
from . import defaults
|
||||
from .import highlevelcrypto
|
||||
from . import queues
|
||||
from . import shared
|
||||
from . import state
|
||||
from . import tr
|
||||
from .addresses import decodeAddress, encodeAddress, encodeVarint
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .fallback import RIPEMD160Hash
|
||||
from .pyelliptic import arithmetic
|
||||
from .pyelliptic.openssl import OpenSSL
|
||||
from .network.threads import StoppableThread
|
||||
|
||||
class addressGenerator(StoppableThread):
|
||||
"""A thread for creating addresses"""
|
||||
|
|
68
src/class_objectProcessor.py
Normal file → Executable file
|
@ -12,28 +12,52 @@ import time
|
|||
from binascii import hexlify
|
||||
from subprocess import call # nosec
|
||||
|
||||
import helper_bitcoin
|
||||
import helper_inbox
|
||||
import helper_msgcoding
|
||||
import helper_sent
|
||||
import highlevelcrypto
|
||||
import knownnodes
|
||||
import l10n
|
||||
import protocol
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint,
|
||||
encodeAddress, encodeVarint, varintDecodeError
|
||||
)
|
||||
from bmconfigparser import BMConfigParser
|
||||
from fallback import RIPEMD160Hash
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
|
||||
from network import bmproto
|
||||
from network.node import Peer
|
||||
try:
|
||||
import helper_bitcoin
|
||||
import helper_inbox
|
||||
import helper_msgcoding
|
||||
import helper_sent
|
||||
import highlevelcrypto
|
||||
import knownnodes
|
||||
import l10n
|
||||
import protocol
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint,
|
||||
encodeAddress, encodeVarint, varintDecodeError
|
||||
)
|
||||
from bmconfigparser import BMConfigParser
|
||||
from fallback import RIPEMD160Hash
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
|
||||
from network import bmproto
|
||||
from network.node import Peer
|
||||
except ModuleNotFoundError:
|
||||
from . import helper_bitcoin
|
||||
from . import helper_inbox
|
||||
from . import helper_msgcoding
|
||||
from . import helper_sent
|
||||
from . import highlevelcrypto
|
||||
from . import knownnodes
|
||||
from . import l10n
|
||||
from . import protocol
|
||||
from . import queues
|
||||
from . import shared
|
||||
from . import state
|
||||
from . import tr
|
||||
from .addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint,
|
||||
encodeAddress, encodeVarint, varintDecodeError
|
||||
)
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .fallback import RIPEMD160Hash
|
||||
from .helper_ackPayload import genAckPayload
|
||||
from .helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
|
||||
from .network import bmproto
|
||||
from .network.node import Peer
|
||||
# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches, too-many-statements
|
||||
|
||||
logger = logging.getLogger('default')
|
||||
|
|
41
src/class_singleCleaner.py
Normal file → Executable file
|
@ -23,18 +23,30 @@ import gc
|
|||
import os
|
||||
from datetime import datetime, timedelta
|
||||
import time
|
||||
import shared
|
||||
|
||||
import knownnodes
|
||||
import queues
|
||||
import state
|
||||
import tr
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
from network.connectionpool import BMConnectionPool
|
||||
from network.threads import StoppableThread
|
||||
try:
|
||||
import shared
|
||||
import knownnodes
|
||||
import queues
|
||||
import state
|
||||
import tr
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
from network.connectionpool import BMConnectionPool
|
||||
from network.threads import StoppableThread
|
||||
|
||||
except ModuleNotFoundError:
|
||||
from . import shared
|
||||
from . import knownnodes
|
||||
from . import queues
|
||||
from . import state
|
||||
from . import tr
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .helper_sql import sqlExecute, sqlQuery
|
||||
from .inventory import Inventory
|
||||
from .network.connectionpool import BMConnectionPool
|
||||
from .network.threads import StoppableThread
|
||||
|
||||
#: Equals 4 weeks. You could make this longer if you want
|
||||
#: but making it shorter would not be advisable because
|
||||
|
@ -82,9 +94,12 @@ class singleCleaner(StoppableThread):
|
|||
# If we are running as a daemon then we are going to fill up the UI
|
||||
# queue which will never be handled by a UI. We should clear it to
|
||||
# save memory.
|
||||
# FIXME redundant?
|
||||
if state.thisapp.daemon or not state.enableGUI:
|
||||
queues.UISignalQueue.queue.clear()
|
||||
# ..FIXME redundant?
|
||||
try:
|
||||
if shared.thisapp.daemon or not state.enableGUI:
|
||||
queues.UISignalQueue.queue.clear()
|
||||
except:
|
||||
pass
|
||||
if timeWeLastClearedInventoryAndPubkeysTables < \
|
||||
int(time.time()) - 7380:
|
||||
timeWeLastClearedInventoryAndPubkeysTables = int(time.time())
|
||||
|
|
59
src/class_singleWorker.py
Normal file → Executable file
|
@ -13,27 +13,48 @@ from binascii import hexlify, unhexlify
|
|||
from struct import pack
|
||||
from subprocess import call # nosec
|
||||
|
||||
import defaults
|
||||
import helper_inbox
|
||||
import helper_msgcoding
|
||||
import helper_random
|
||||
import highlevelcrypto
|
||||
import l10n
|
||||
import proofofwork
|
||||
import protocol
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint, encodeVarint
|
||||
)
|
||||
try:
|
||||
import defaults
|
||||
import helper_inbox
|
||||
import helper_msgcoding
|
||||
import helper_random
|
||||
import highlevelcrypto
|
||||
import l10n
|
||||
import proofofwork
|
||||
import protocol
|
||||
import queues
|
||||
import shared
|
||||
import state
|
||||
import tr
|
||||
from addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint, encodeVarint
|
||||
)
|
||||
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
from network.threads import StoppableThread
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_sql import sqlExecute, sqlQuery
|
||||
from inventory import Inventory
|
||||
from network.threads import StoppableThread
|
||||
except ModuleNotFoundError:
|
||||
from . import defaults
|
||||
from . import helper_inbox
|
||||
from . import helper_msgcoding
|
||||
from . import helper_random
|
||||
from . import highlevelcrypto
|
||||
from . import l10n
|
||||
from . import proofofwork
|
||||
from . import protocol
|
||||
from . import queues
|
||||
from . import shared
|
||||
from . import state
|
||||
from . import tr
|
||||
from .addresses import (
|
||||
calculateInventoryHash, decodeAddress, decodeVarint, encodeVarint
|
||||
)
|
||||
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .helper_sql import sqlExecute, sqlQuery
|
||||
from .inventory import Inventory
|
||||
from .network.threads import StoppableThread
|
||||
# This thread, of which there is only one, does the heavy lifting:
|
||||
# calculating POWs.
|
||||
|
||||
|
|
18
src/class_smtpDeliver.py
Normal file → Executable file
|
@ -3,15 +3,23 @@ SMTP client thread for delivering emails
|
|||
"""
|
||||
# pylint: disable=unused-variable
|
||||
import smtplib
|
||||
import urlparse
|
||||
import urllib.parse as urlparse
|
||||
from email.header import Header
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
import queues
|
||||
import state
|
||||
from bmconfigparser import BMConfigParser
|
||||
from network.threads import StoppableThread
|
||||
try:
|
||||
import queues
|
||||
import state
|
||||
from bmconfigparser import BMConfigParser
|
||||
from network.threads import StoppableThread
|
||||
|
||||
except ModuleNotFoundError:
|
||||
from . import queues
|
||||
from . import state
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .network.threads import StoppableThread
|
||||
|
||||
|
||||
SMTPDOMAIN = "bmaddr.lan"
|
||||
|
||||
|
||||
|
|
24
src/class_smtpServer.py
Normal file → Executable file
|
@ -12,14 +12,22 @@ import threading
|
|||
import time
|
||||
from email.header import decode_header
|
||||
from email.parser import Parser
|
||||
|
||||
import queues
|
||||
from addresses import decodeAddress
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlExecute
|
||||
from network.threads import StoppableThread
|
||||
from version import softwareVersion
|
||||
try:
|
||||
import queues
|
||||
from addresses import decodeAddress
|
||||
from bmconfigparser import BMConfigParser
|
||||
from helper_ackPayload import genAckPayload
|
||||
from helper_sql import sqlExecute
|
||||
from network.threads import StoppableThread
|
||||
from version import softwareVersion
|
||||
except ModuleNotFoundError:
|
||||
from . import queues
|
||||
from .addresses import decodeAddress
|
||||
from .bmconfigparser import BMConfigParser
|
||||
from .helper_ackPayload import genAckPayload
|
||||
from .helper_sql import sqlExecute
|
||||
from .network.threads import StoppableThread
|
||||
from .version import softwareVersion
|
||||
|
||||
SMTPDOMAIN = "bmaddr.lan"
|
||||
LISTENPORT = 8425
|
||||
|
|