text stringlengths 1 93.6k |
|---|
data[self.treeview.item(Parent)["text"]]=[]
|
for child in self.treeview.get_children(Parent):
|
if self.treeview.item(child)["values"] not in data[self.treeview.item(Parent)["text"]]:
|
data[self.treeview.item(Parent)["text"]].append(self.treeview.item(child)["values"])
|
return data
|
def save_investigation(self):
|
"""Saves investigation data"""
|
if not self.investigation_id_tracker:
|
self.investigation_id_tracker = datetime.datetime.now().strftime("%Y-%m-%d_%H:%M")
|
data = self.grab_investigation_data()
|
self.save = SaveTool(investigation_id=self.investigation_id_tracker, data=data)
|
self.save.title('Save investigation')
|
self.save.geometry('+%d+%d' % (root.winfo_x() +
|
20, root.winfo_y() + 20))
|
if sys.platform == "win32":
|
self.save.iconbitmap(self.icon)
|
self.save.resizable(width=False, height=False)
|
self.save.protocol('WM_DELETE_WINDOW', self.save.quit_save)
|
# set focus on window
|
self.save.grab_set()
|
self.save.focus()
|
# start mainloop
|
self.save.mainloop()
|
def open_investigation(self):
|
"""Open investigation data"""
|
db = Database()
|
investigation_ids = db.retrieve_investigation_ids()
|
if not investigation_ids:
|
messagebox.showinfo("No saved investigations", "Please save an investigation before loading data")
|
db.close_connection()
|
if investigation_ids:
|
# clear investigation id
|
self.investigation_id_tracker = ""
|
self.open = OpenTool()
|
self.open.title('Open investigation')
|
self.open.geometry('+%d+%d' % (root.winfo_x() +
|
20, root.winfo_y() + 20))
|
if sys.platform == "win32":
|
self.open.iconbitmap(self.icon)
|
self.open.resizable(width=False, height=False)
|
self.open.protocol('WM_DELETE_WINDOW', self.open.quit_open)
|
# set focus on window
|
self.open.grab_set()
|
self.open.focus()
|
# start mainloop
|
self.open.mainloop()
|
def delete_investigation(self):
|
"""Delete investigation data"""
|
self.delete = DeleteTool()
|
self.delete.title('Delete investigation')
|
self.delete.geometry('+%d+%d' % (root.winfo_x() +
|
20, root.winfo_y() + 20))
|
if sys.platform == "win32":
|
self.delete.iconbitmap(self.icon)
|
self.delete.resizable(width=False, height=False)
|
self.delete.protocol('WM_DELETE_WINDOW', self.delete.quit)
|
# set focus on window
|
self.delete.grab_set()
|
self.delete.focus()
|
# start mainloop
|
self.delete.mainloop()
|
def clear_investigation_data(self, event=None):
|
"""Clears investigation data from treeview"""
|
self.treeview.delete(*pockint.treeview.get_children())
|
self.id_tracker = {}
|
self.entry.delete(0, "end")
|
self.validate_input()
|
@staticmethod
|
def quit_program():
|
"""Quits main program window"""
|
root.destroy()
|
if __name__ == '__main__':
|
root = tk.Tk()
|
root.title("POCKINT v.{}".format(__version__))
|
pockint = Gui(root)
|
root.config(menu=pockint.top)
|
pockint.pack(expand=False)
|
if sys.platform == "win32":
|
root.iconbitmap(pockint.icon)
|
root.protocol('WM_DELETE_WINDOW', pockint.quit_program)
|
root.mainloop()
|
# <FILESEP>
|
## Wombat: by @Saffire33 a.k.a. Hattendo
|
## Bashir: by @MachineArts a.k.a @newsbubbles
|
import os, time, uuid, argparse, pexpect
|
from langchain.chat_models import ChatOpenAI
|
from langchain.schema import SystemMessage, HumanMessage, AIMessage
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.