removed gui
This commit is contained in:
parent
e2c5fa3744
commit
ea5f18d4e1
@ -379,7 +379,7 @@ class Core:
|
|||||||
events.event('queue_push', data = {'command': command, 'data': data}, onionr = None)
|
events.event('queue_push', data = {'command': command, 'data': data}, onionr = None)
|
||||||
conn.close()
|
conn.close()
|
||||||
return retData
|
return retData
|
||||||
|
|
||||||
def daemonQueueGetResponse(self, responseID=''):
|
def daemonQueueGetResponse(self, responseID=''):
|
||||||
'''
|
'''
|
||||||
Get a response sent by communicator to the API, by requesting to the API
|
Get a response sent by communicator to the API, by requesting to the API
|
||||||
@ -387,14 +387,14 @@ class Core:
|
|||||||
assert len(responseID) > 0
|
assert len(responseID) > 0
|
||||||
resp = self._utils.localCommand('queueResponse/' + responseID)
|
resp = self._utils.localCommand('queueResponse/' + responseID)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def daemonQueueWaitForResponse(self, responseID='', checkFreqSecs=1):
|
def daemonQueueWaitForResponse(self, responseID='', checkFreqSecs=1):
|
||||||
resp = 'failure'
|
resp = 'failure'
|
||||||
while resp == 'failure':
|
while resp == 'failure':
|
||||||
resp = self.daemonQueueGetResponse(responseID)
|
resp = self.daemonQueueGetResponse(responseID)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def daemonQueueSimple(self, command, data='', checkFreqSecs=1):
|
def daemonQueueSimple(self, command, data='', checkFreqSecs=1):
|
||||||
'''
|
'''
|
||||||
A simplified way to use the daemon queue. Will register a command (with optional data) and wait, return the data
|
A simplified way to use the daemon queue. Will register a command (with optional data) and wait, return the data
|
||||||
@ -591,7 +591,7 @@ class Core:
|
|||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
command = (data, address)
|
command = (data, address)
|
||||||
|
|
||||||
if key not in ('address', 'type', 'knownPeer', 'speed', 'success', 'DBHash', 'failure', 'powValue', 'lastConnect', 'lastConnectAttempt', 'trust', 'introduced'):
|
if key not in ('address', 'type', 'knownPeer', 'speed', 'success', 'DBHash', 'failure', 'powValue', 'lastConnect', 'lastConnectAttempt', 'trust', 'introduced'):
|
||||||
raise Exception("Got invalid database key when setting address info")
|
raise Exception("Got invalid database key when setting address info")
|
||||||
else:
|
else:
|
||||||
|
@ -39,7 +39,7 @@ class OnionrBlackList:
|
|||||||
for i in self._dbExecute("SELECT * FROM blacklist WHERE hash = ?", (hashed,)):
|
for i in self._dbExecute("SELECT * FROM blacklist WHERE hash = ?", (hashed,)):
|
||||||
retData = True # this only executes if an entry is present by that hash
|
retData = True # this only executes if an entry is present by that hash
|
||||||
break
|
break
|
||||||
|
|
||||||
return retData
|
return retData
|
||||||
|
|
||||||
def _dbExecute(self, toExec, params = ()):
|
def _dbExecute(self, toExec, params = ()):
|
||||||
@ -82,7 +82,7 @@ class OnionrBlackList:
|
|||||||
return
|
return
|
||||||
|
|
||||||
def clearDB(self):
|
def clearDB(self):
|
||||||
self._dbExecute('''DELETE FROM blacklist;);''')
|
self._dbExecute('''DELETE FROM blacklist;''')
|
||||||
|
|
||||||
def getList(self):
|
def getList(self):
|
||||||
data = self._dbExecute('SELECT * FROM blacklist')
|
data = self._dbExecute('SELECT * FROM blacklist')
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import threading, time
|
|
||||||
from tkinter import *
|
|
||||||
import core
|
|
||||||
class OnionrGUI:
|
|
||||||
def __init__(self):
|
|
||||||
self.dataDir = "/programming/onionr/data/"
|
|
||||||
self.root = Tk()
|
|
||||||
self.root.geometry("450x250")
|
|
||||||
self.core = core.Core()
|
|
||||||
menubar = Menu(self.root)
|
|
||||||
|
|
||||||
# create a pulldown menu, and add it to the menu bar
|
|
||||||
filemenu = Menu(menubar, tearoff=0)
|
|
||||||
#filemenu.add_command(label="Open", command=None)
|
|
||||||
filemenu.add_separator()
|
|
||||||
filemenu.add_command(label="Exit", command=self.root.quit)
|
|
||||||
menubar.add_cascade(label="File", menu=filemenu)
|
|
||||||
|
|
||||||
settingsmenu = Menu(menubar, tearoff=0)
|
|
||||||
menubar.add_cascade(label="Settings", menu=settingsmenu)
|
|
||||||
|
|
||||||
helpmenu = Menu(menubar, tearoff=0)
|
|
||||||
menubar.add_cascade(label="Help", menu=helpmenu)
|
|
||||||
|
|
||||||
self.root.config(menu=menubar)
|
|
||||||
|
|
||||||
self.menuFrame = Frame(self.root)
|
|
||||||
self.tabButton1 = Button(self.menuFrame, text="Mail", command=self.openMail)
|
|
||||||
self.tabButton1.grid(row=0, column=1, padx=0, pady=2, sticky=N+W)
|
|
||||||
self.tabButton2 = Button(self.menuFrame, text="Message Flow")
|
|
||||||
self.tabButton2.grid(row=0, column=3, padx=0, pady=2, sticky=N+W)
|
|
||||||
|
|
||||||
self.menuFrame.grid(row=0, column=0, padx=2, pady=0, sticky=N+W)
|
|
||||||
|
|
||||||
self.idFrame = Frame(self.root)
|
|
||||||
|
|
||||||
self.ourIDLabel = Label(self.idFrame, text="ID: ")
|
|
||||||
self.ourIDLabel.grid(row=2, column=0, padx=1, pady=1, sticky=N+W)
|
|
||||||
self.ourID = Entry(self.idFrame)
|
|
||||||
self.ourID.insert(0, self.core._crypto.pubKey)
|
|
||||||
self.ourID.grid(row=2, column=1, padx=1, pady=1, sticky=N+W)
|
|
||||||
self.ourID.config(state='readonly')
|
|
||||||
self.idFrame.grid(row=1, column=0, padx=2, pady=2, sticky=N+W)
|
|
||||||
|
|
||||||
self.syncStatus = Label(self.root, text="Sync Status: 15/100")
|
|
||||||
self.syncStatus.place(relx=1.0, rely=1.0, anchor=S+E)
|
|
||||||
self.peerCount = Label(self.root, text="Connected Peers: ")
|
|
||||||
self.peerCount.place(relx=0.0, rely=1.0, anchor='sw')
|
|
||||||
|
|
||||||
self.root.wm_title("Onionr")
|
|
||||||
threading.Thread(target=self.updateStats)
|
|
||||||
self.root.mainloop()
|
|
||||||
return
|
|
||||||
|
|
||||||
def updateStats(self):
|
|
||||||
#self.core._utils.localCommand()
|
|
||||||
self.peerCount.config(text='Connected Peers: %s' % ())
|
|
||||||
time.sleep(1)
|
|
||||||
return
|
|
||||||
def openMail(self):
|
|
||||||
MailWindow(self)
|
|
||||||
|
|
||||||
|
|
||||||
class MailWindow:
|
|
||||||
def __init__(self, mainGUI):
|
|
||||||
assert isinstance(mainGUI, OnionrGUI)
|
|
||||||
self.core = mainGUI.core
|
|
||||||
self.mailRoot = Toplevel()
|
|
||||||
|
|
||||||
self.inboxFrame = Frame(self.mailRoot)
|
|
||||||
self.sentboxFrame = Frame(self.mailRoot)
|
|
||||||
self.composeFrame = Frame(self.mailRoot)
|
|
||||||
|
|
||||||
|
|
||||||
self.mailRoot.mainloop()
|
|
||||||
|
|
||||||
OnionrGUI()
|
|
Loading…
Reference in New Issue
Block a user