Added a number of missing imports fixing several issues (thank you PyDev)
This commit is contained in:
parent
e9dc2d5c5e
commit
2eb6558cf1
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,3 +3,5 @@
|
|||
**.DS_Store
|
||||
src/build
|
||||
src/dist
|
||||
src/.project
|
||||
src/.pydevprojecy
|
||||
|
|
|
@ -9,7 +9,7 @@ Usage (Windows):
|
|||
"""
|
||||
|
||||
import sys, os, shutil, re
|
||||
from setuptools import setup
|
||||
from setuptools import setup # @UnresolvedImport
|
||||
|
||||
|
||||
name = "Bitmessage"
|
||||
|
|
|
@ -2,9 +2,11 @@ import shared
|
|||
import threading
|
||||
import bitmessagemain
|
||||
import time
|
||||
import sys
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
import ctypes
|
||||
import hashlib
|
||||
import highlevelcrypto
|
||||
from addresses import *
|
||||
from pyelliptic import arithmetic
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ class outgoingSynSender(threading.Thread):
|
|||
shared.printLock.release()
|
||||
except socks.Socks5AuthError as err:
|
||||
shared.UISignalQueue.put((
|
||||
'updateStatusBar', translateText(
|
||||
'updateStatusBar', bitmessagemain.translateText(
|
||||
"MainWindow", "SOCKS5 Authentication problem: %1").arg(str(err))))
|
||||
except socks.Socks5Error as err:
|
||||
pass
|
||||
|
|
|
@ -7,9 +7,16 @@ import pickle
|
|||
import random
|
||||
from struct import unpack, pack
|
||||
import sys
|
||||
import string
|
||||
from subprocess import call # used when the API must execute an outside program
|
||||
from pyelliptic.openssl import OpenSSL
|
||||
|
||||
import highlevelcrypto
|
||||
from addresses import *
|
||||
import helper_generic
|
||||
import helper_bitcoin
|
||||
import helper_inbox
|
||||
import helper_sent
|
||||
import bitmessagemain
|
||||
from bitmessagemain import lengthOfTimeToLeaveObjectsInInventory, lengthOfTimeToHoldOnToAllPubkeys, maximumAgeOfAnObjectThatIAmWillingToAccept, maximumAgeOfObjectsThatIAdvertiseToOthers, maximumAgeOfNodesThatIAdvertiseToOthers, numberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer, neededPubkeys
|
||||
|
||||
|
@ -814,8 +821,8 @@ class receiveDataThread(threading.Thread):
|
|||
shared.sqlReturnQueue.get()
|
||||
shared.sqlSubmitQueue.put('commit')
|
||||
shared.sqlLock.release()
|
||||
shared.UISignalQueue.put(('updateSentItemStatusByAckdata', (encryptedData[readPosition:], translateText("MainWindow",'Acknowledgement of the message received. %1').arg(unicode(
|
||||
strftime(shared.config.get('bitmessagesettings', 'timeformat'), localtime(int(time.time()))), 'utf-8')))))
|
||||
shared.UISignalQueue.put(('updateSentItemStatusByAckdata', (encryptedData[readPosition:], bitmessagemain.translateText("MainWindow",'Acknowledgement of the message received. %1').arg(unicode(
|
||||
time.strftime(shared.config.get('bitmessagesettings', 'timeformat'), time.localtime(int(time.time()))), 'utf-8')))))
|
||||
return
|
||||
else:
|
||||
shared.printLock.acquire()
|
||||
|
@ -1046,7 +1053,7 @@ class receiveDataThread(threading.Thread):
|
|||
subject = self.addMailingListNameToSubject(
|
||||
subject, mailingListName)
|
||||
# Let us now send this message out as a broadcast
|
||||
message = strftime("%a, %Y-%m-%d %H:%M:%S UTC", gmtime(
|
||||
message = time.strftime("%a, %Y-%m-%d %H:%M:%S UTC", time.gmtime(
|
||||
)) + ' Message ostensibly from ' + fromAddress + ':\n\n' + body
|
||||
fromAddress = toAddress # The fromAddress for the broadcast that we are about to send is the toAddress (my address) for the msg message we are currently processing.
|
||||
ackdata = OpenSSL.rand(
|
||||
|
@ -1069,14 +1076,14 @@ class receiveDataThread(threading.Thread):
|
|||
# Display timing data
|
||||
timeRequiredToAttemptToDecryptMessage = time.time(
|
||||
) - self.messageProcessingStartTime
|
||||
successfullyDecryptMessageTimings.append(
|
||||
bitmessagemain.successfullyDecryptMessageTimings.append(
|
||||
timeRequiredToAttemptToDecryptMessage)
|
||||
sum = 0
|
||||
for item in successfullyDecryptMessageTimings:
|
||||
for item in bitmessagemain.successfullyDecryptMessageTimings:
|
||||
sum += item
|
||||
shared.printLock.acquire()
|
||||
print 'Time to decrypt this message successfully:', timeRequiredToAttemptToDecryptMessage
|
||||
print 'Average time for all message decryption successes since startup:', sum / len(successfullyDecryptMessageTimings)
|
||||
print 'Average time for all message decryption successes since startup:', sum / len(bitmessagemain.successfullyDecryptMessageTimings)
|
||||
shared.printLock.release()
|
||||
|
||||
def isAckDataValid(self, ackData):
|
||||
|
|
|
@ -4,6 +4,9 @@ import shared
|
|||
import Queue
|
||||
from struct import unpack, pack
|
||||
import hashlib
|
||||
import random
|
||||
import sys
|
||||
import socket
|
||||
|
||||
import bitmessagemain
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import threading
|
||||
import shared
|
||||
import time
|
||||
from bitmessagemain import lengthOfTimeToLeaveObjectsInInventory, lengthOfTimeToHoldOnToAllPubkeys, maximumAgeOfAnObjectThatIAmWillingToAccept, maximumAgeOfObjectsThatIAdvertiseToOthers, maximumAgeOfNodesThatIAdvertiseToOthers
|
||||
from bitmessagemain import lengthOfTimeToLeaveObjectsInInventory, lengthOfTimeToHoldOnToAllPubkeys, maximumAgeOfAnObjectThatIAmWillingToAccept, maximumAgeOfObjectsThatIAdvertiseToOthers, maximumAgeOfNodesThatIAdvertiseToOthers,\
|
||||
neededPubkeys
|
||||
import sys
|
||||
|
||||
'''The singleCleaner class is a timer-driven thread that cleans data structures to free memory, resends messages when a remote node doesn't respond, and sends pong messages to keep connections alive if the network isn't busy.
|
||||
It cleans these data structures in memory:
|
||||
|
|
|
@ -7,6 +7,9 @@ from addresses import *
|
|||
import bitmessagemain
|
||||
import highlevelcrypto
|
||||
import proofofwork
|
||||
from bitmessagemain import neededPubkeys, encryptedBroadcastSwitchoverTime
|
||||
import sys
|
||||
from class_addressGenerator import pointMult
|
||||
|
||||
# This thread, of which there is only one, does the heavy lifting:
|
||||
# calculating POWs.
|
||||
|
|
|
@ -4,6 +4,7 @@ import sqlite3
|
|||
import time
|
||||
import shutil # used for moving the messages.dat file
|
||||
import sys
|
||||
import os
|
||||
|
||||
# This thread exists because SQLITE3 is so un-threadsafe that we must
|
||||
# submit queries to it and it puts results back in a different queue. They
|
||||
|
|
|
@ -59,7 +59,7 @@ if __name__ == "__main__":
|
|||
APPNAME = "PyBitmessage"
|
||||
from os import path, environ
|
||||
if sys.platform == 'darwin':
|
||||
from AppKit import NSSearchPathForDirectoriesInDomains
|
||||
from AppKit import NSSearchPathForDirectoriesInDomains # @UnresolvedImport
|
||||
# http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSearchPathForDirectoriesInDomains
|
||||
# NSApplicationSupportDirectory = 14
|
||||
# NSUserDomainMask = 1
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import shared
|
||||
import sys
|
||||
|
||||
def convertIntToString(n):
|
||||
a = __builtins__.hex(n)
|
||||
|
|
|
@ -8,7 +8,6 @@ storeConfigFilesInSameDirectoryAsProgramByDefault = False # The user may de-sel
|
|||
def loadConfig():
|
||||
# First try to load the config file (the keys.dat file) from the program
|
||||
# directory
|
||||
shared.config = ConfigParser.SafeConfigParser()
|
||||
shared.config.read('keys.dat')
|
||||
try:
|
||||
shared.config.get('bitmessagesettings', 'settingsversion')
|
||||
|
|
|
@ -4,16 +4,17 @@
|
|||
import hashlib
|
||||
from struct import unpack, pack
|
||||
import sys
|
||||
from shared import config
|
||||
#import os
|
||||
|
||||
def _set_idle():
|
||||
if 'linux' in sys.platform:
|
||||
import os
|
||||
os.nice(20)
|
||||
os.nice(20) # @UndefinedVariable
|
||||
else:
|
||||
try:
|
||||
sys.getwindowsversion()
|
||||
import win32api,win32process,win32con
|
||||
import win32api,win32process,win32con # @UnresolvedImport
|
||||
pid = win32api.GetCurrentProcessId()
|
||||
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
|
||||
win32process.SetPriorityClass(handle, win32process.IDLE_PRIORITY_CLASS)
|
||||
|
|
|
@ -8,7 +8,9 @@ import Queue
|
|||
import pickle
|
||||
import os
|
||||
import time
|
||||
import ConfigParser
|
||||
|
||||
config = ConfigParser.SafeConfigParser()
|
||||
myECCryptorObjects = {}
|
||||
MyECSubscriptionCryptorObjects = {}
|
||||
myAddressesByHash = {} #The key in this dictionary is the RIPE hash which is encoded in an address and value is the address itself.
|
||||
|
|
|
@ -34,7 +34,7 @@ class singleinstance:
|
|||
print(e.errno)
|
||||
raise
|
||||
else: # non Windows
|
||||
import fcntl
|
||||
import fcntl # @UnresolvedImport
|
||||
self.fp = open(self.lockfile, 'w')
|
||||
try:
|
||||
fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
|
@ -53,7 +53,7 @@ class singleinstance:
|
|||
os.close(self.fd)
|
||||
os.unlink(self.lockfile)
|
||||
else:
|
||||
import fcntl
|
||||
import fcntl # @UnresolvedImport
|
||||
fcntl.lockf(self.fp, fcntl.LOCK_UN)
|
||||
if os.path.isfile(self.lockfile):
|
||||
os.unlink(self.lockfile)
|
||||
|
|
Reference in New Issue
Block a user