Skip to content

Commit

Permalink
Changes are made to build Groot using pyinstaller.
Browse files Browse the repository at this point in the history
	- Created entry point 'cli.py' for application. So it was
	neccesory to change import statements
	- Pyinstaller was not able to import markdown extension modules
	so individual classes of all extension modules were needed to
	import.
  • Loading branch information
hitanshu-mehta committed May 10, 2020
1 parent 4fe15c4 commit 28a4a41
Show file tree
Hide file tree
Showing 144 changed files with 2,228 additions and 150,300 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
environment/
.vscode/
.vscode/
build
dist
cli.spec
Binary file modified Application/GUIs/__pycache__/firstLoginDialog.cpython-37.pyc
Binary file not shown.
Binary file modified Application/GUIs/__pycache__/loginDialog.cpython-37.pyc
Binary file not shown.
Binary file modified Application/GUIs/__pycache__/mainWindowPTE.cpython-37.pyc
Binary file not shown.
Binary file modified Application/GUIs/__pycache__/passwordDialog.cpython-37.pyc
Binary file not shown.
Binary file modified Application/GUIs/__pycache__/settingsDialog.cpython-37.pyc
Binary file not shown.
Binary file modified Application/GUIs/__pycache__/verifyPasswordDialog.cpython-37.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Application/GUIs/firstLoginDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_firstLoginDialog(object):
def setupUi(self, firstLoginDialog):
Expand Down
2 changes: 1 addition & 1 deletion Application/GUIs/loginDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_loginDialog(object):
def setupUi(self, loginDialog):
Expand Down
2 changes: 1 addition & 1 deletion Application/GUIs/mainWindowPTE.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_Groot(object):
def setupUi(self, Groot):
Expand Down
2 changes: 1 addition & 1 deletion Application/GUIs/passwordDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_passwordDialog(object):
def setupUi(self, passwordDialog):
Expand Down
2 changes: 1 addition & 1 deletion Application/GUIs/settingsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_settingDialog(object):
def setupUi(self, settingDialog):
Expand Down
2 changes: 1 addition & 1 deletion Application/GUIs/verifyPasswordDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QPixmap, QRadialGradient)
from PySide2.QtWidgets import *

import resource_rc
import Application.resource_rc

class Ui_verifyPasswordDialog(object):
def setupUi(self, verifyPasswordDialog):
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file added Application/Icons/App Icon/groot_16.png
Binary file added Application/Icons/App Icon/groot_256.png
Binary file added Application/Icons/App Icon/groot_32.png
Binary file added Application/Icons/App Icon/groot_48.png
Binary file added Application/Icons/App Icon/groot_icon.ico
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
8 changes: 4 additions & 4 deletions Application/User/login.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fgs
b'\xc5\r\xff\xb0\xd8\x0b\x15\x1a\xaf\xc9\xde\xd1\xb5\xf0D\xd6cA\x84\x17`3\x11\xc4:cH\xb97x\xf7O\x12\r\xb77\x87\xd0\xce\xbec\xb6\xa7\x8c\x08\xceE\xeb\x02\xed\xd4\x9d\xda--q\xdeA\xab\x05\xe0T\xe9\xe7'
b'\x845\xe4\xa47\x1d\x9a\x7f\x87\x94\xf2&/\xe7f\xcbJC\xbb\x99.\xe9\xbdv\xdcI\xe8\xab\xed\x9f~g\xc2J+\xe6\x9b\x93t\xda\x9b]\xa6\x96H#v\x98\\\x1b"C\xb3\xba\xaee\x1e\x1b`.\xd6+qQ'
False
a
b"\xc5x\xb3pe+\x84\xc5\xdd\x99N\xa3\x89a\x86]\x0f\xcf\x1f\x9aIA%e\x7f3\xdc`\xe7j\xa9\x15\xa9\xc8\x8b\xb4\xe0Sb\x92\xa0u\x8b\xe8\xddM\xd6T'\xcdy&\xf9&\xa8\x0b\x1d\x84\xc1\xc1\x01\xf9M\xd0"
b'\xda\x8e\xcci\x15\x15\x9e\xc9|t\xc0\xe3:\x9fb\x0e\xb1n\xd0\x92\xf2kQT\xf6\xa7\x90\xb1N\xb0\x9d\x82\xe2\xf1[o[^\x8dI\xf2\xd4S=\xce\xf5\xd9\xf0E^\x8dD\x07\x99\xd3\x81\xe0\x9d!\x147\xa4\xe7X'
True
18 changes: 18 additions & 0 deletions Application/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from PySide2 import QtWidgets,QtCore
from Application.mainWindow import Window
import sys

def main():
try:
from PyQt5.QtWinExtras import QtWin
myappid = 'mycompany.myproduct.subproduct.version'
QtWin.setCurrentProcessExplicitAppUserModelID(myappid)
except ImportError:
pass

app = QtWidgets.QApplication(sys.argv)
window = Window()
sys.exit(app.exec_())

if __name__ == "__main__":
main()
Binary file added Application/__pycache__/__main__.cpython-37.pyc
Binary file not shown.
Binary file modified Application/__pycache__/main.cpython-37.pyc
Binary file not shown.
Binary file modified Application/__pycache__/mainWindow.cpython-37.pyc
Binary file not shown.
Binary file modified Application/__pycache__/mainWindowFunctions.cpython-37.pyc
Binary file not shown.
Binary file modified Application/__pycache__/resource_rc.cpython-37.pyc
Binary file not shown.
5 changes: 4 additions & 1 deletion Application/fileStructure.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"Notebooks": {"28042020215654": {"name": "Notebook1", "expanded": {"28042020215703": {"name": "sub-notebook1", "expanded": {"06052020172738": {"name": "note1", "expanded": {"path": "./notes/06052020172738.txt", "randomString": "06052020172738"}}}}, "28042020220402": {"name": "sub-notebook2", "expanded": {"06052020172824": {"name": "note2", "expanded": {"path": "./notes/06052020172824.txt", "randomString": "06052020172824"}}}}}}}, "Uncategorized": {"06052020172515": {"name": "note1", "expanded": {"path": "./notes/06052020172515.txt", "randomString": "06052020172515", "encrypted": "False", "salt": "b\"\\xf1_\\x92\\xfc\\x02\\r\\xdd\\x03\\xa3\\xa5\\x06\\xf6\\x8d'p\\xa4o\\x1c\\x1e\\xf8\\xa1\\xa8\\x16\\xe1\\xb9B\\xcd\\xc0R*\\x12\\xc4c~\\xb2)\\x91R\\x0fP\\xb18.\\x0fQ\\x95\\x81\\xb4\\x94\\x11\\x81\\xfd\\xef\\x15\\xa4\\xe4\\x05\\xaejDvG;z\"", "h_pass": "b'\\xfaM1Y8\\x15 i\\x1d\\xcd\\xec\\xe3m\\x04\\x11\\xa2\\xf7\\x13\\xac\\xca\\xd3\\xc27\\xf9\\xa3\"<u:=E\\x1d\\xfd\\xcb\\xed\\xa9U\\x8bQt\\xe0*\\x00\\x9f\\xa3Ch\\xec\\xd2t|\\x8d\\xecL0\\xad\\xb6\\x13L\\xc9C\\xc5\\x0f\\xe8'", "atchfiles": ["./atch/08052020020950", "./atch/08052020021942"]}}}}
{
"Notebooks": {},
"Uncategorized": {}
}
16 changes: 0 additions & 16 deletions Application/main.py

This file was deleted.

146 changes: 74 additions & 72 deletions Application/mainWindow.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from PySide2 import QtWidgets, QtCore, QtGui

# import GUIs
from GUIs.mainWindowPTE import Ui_Groot
from Application.GUIs.mainWindowPTE import Ui_Groot

# import modules
from modules.userLogin import readUserInfo,storeUserInfoInFile
from modules.GUIchanges import fixTreeViewScrolling, createNotebook, createSubNotebook, createNote, rename, dlt, importer, exportPDF, exportHTML, exportMD, copyLink
import mainWindowFunctions
from modules.markdownHandling import bold, italic, numList, bulletList, hyperlink, inlineCode, datetimenow, attachFile, exportAsPdf, exportAsHtml, exportAsMarkdown, importMD, copyMarkdownLink
from GUIs.settingsDialog import Ui_settingDialog
import Application.mainWindowFunctions
from Application.modules.userLogin import readUserInfo,storeUserInfoInFile
from Application.modules.GUIchanges import fixTreeViewScrolling, createNotebook, createSubNotebook, createNote, rename, dlt, importer, exportPDF, exportHTML, exportMD, copyLink
from Application.modules.markdownHandling import bold, italic, numList, bulletList, hyperlink, inlineCode, datetimenow, attachFile, exportAsPdf, exportAsHtml, exportAsMarkdown, importMD, copyMarkdownLink
from Application.GUIs.settingsDialog import Ui_settingDialog

class Window(QtWidgets.QMainWindow):
def __init__(self):
Expand All @@ -20,7 +20,13 @@ def __init__(self):

self.mdExtensions = [] # Extensions for changing behaviour of markdown viewer
self.mdExtensionsConfigs = {} # Extensions configurations for changing the behaviour of extensions in markdown


if(self.checkFirstLogin()):
QtCore.QTimer.singleShot(0,self,self.openLoginDialog())
else:
QtCore.QTimer.singleShot(0,self,self.openFirstLoginDialog())

self.userInfo = readUserInfo()
if(self.userInfo[3] == "True"):
self.encryptAll = True
Expand Down Expand Up @@ -88,8 +94,8 @@ def __init__(self):
self.ui.bullets.clicked.connect(lambda: bulletList(self.ui.plainTextEdit))

# hyperlink connection
self.ui.link.clicked.connect(lambda: hyperlink(self.ui.plainTextEdit))
self.ui.actionLink.triggered.connect(lambda: hyperlink(self.ui.plainTextEdit))
self.ui.link.clicked.connect(lambda: hyperlink(self))
self.ui.actionLink.triggered.connect(lambda: hyperlink(self))

# inline code connection
self.ui.code.clicked.connect(lambda: inlineCode(self.ui.plainTextEdit))
Expand All @@ -100,23 +106,23 @@ def __init__(self):
self.ui.actionDate_and_Time.triggered.connect(lambda: datetimenow(self.ui.plainTextEdit))

# attaching file connection
self.ui.insertFile.clicked.connect(lambda: attachFile(self.ui.plainTextEdit))
self.ui.actionImage.triggered.connect(lambda: attachFile(self.ui.plainTextEdit))
self.ui.insertFile.clicked.connect(lambda: attachFile(self))
self.ui.actionImage.triggered.connect(lambda: attachFile(self))

# attach copying of markdown link
copyLink.triggered.connect(copyMarkdownLink)

# export as PDF connection
self.ui.actionPDF.triggered.connect(lambda: exportAsPdf(self.ui.mdViewer))
exportPDF.triggered.connect(lambda: exportAsPdf(self.ui.mdViewer))
self.ui.actionPDF.triggered.connect(lambda: exportAsPdf(self))
exportPDF.triggered.connect(lambda: exportAsPdf(self))

# export as Markdown connection
self.ui.actionMD_2.triggered.connect(lambda: exportAsMarkdown(self.ui.plainTextEdit.toPlainText()))
exportMD.triggered.connect(lambda: exportAsMarkdown(self.ui.plainTextEdit.toPlainText()))
self.ui.actionMD_2.triggered.connect(lambda: exportAsMarkdown(self))
exportMD.triggered.connect(lambda: exportAsMarkdown(self))

# export as Html connection
self.ui.actionHTML.triggered.connect(lambda: exportAsHtml(self.ui.plainTextEdit.toPlainText(),self.mdExtensions))
exportHTML.triggered.connect(lambda: exportAsHtml(self.ui.plainTextEdit.toPlainText(),self.mdExtensions))
self.ui.actionHTML.triggered.connect(lambda: exportAsHtml(self,self.mdExtensions))
exportHTML.triggered.connect(lambda: exportAsHtml(self,self.mdExtensions))

# search in note connection
self.ui.actionSearch_in_Current_Note.triggered.connect(lambda:self.ui.searchBar.setFocus())
Expand Down Expand Up @@ -184,59 +190,55 @@ def __init__(self):
# close main window from menu
self.ui.actionQuit.triggered.connect(lambda:self.closeDialogAndMainWindow())

if(self.checkFirstLogin()):
QtCore.QTimer.singleShot(0,self,self.openLoginDialog())
else:
QtCore.QTimer.singleShot(0,self,self.openFirstLoginDialog())




Window._noteLoader = mainWindowFunctions._noteLoader
Window.closeEvent = mainWindowFunctions.closeEvent
Window.reloadUI = mainWindowFunctions.reloadUI
Window.decryptNote = mainWindowFunctions.decryptNote
Window.encryptNote = mainWindowFunctions.encryptNote
Window._markdownViewer = mainWindowFunctions._markdownViewer
Window._delayChecker = mainWindowFunctions._delayChecker
Window.showMenu = mainWindowFunctions.showMenu
Window.searchInNote = mainWindowFunctions.searchInNote
Window.searchModeChanged = mainWindowFunctions.searchModeChanged
Window.findNextOccurance = mainWindowFunctions.findNextOccurance
Window.findPrevOccurance = mainWindowFunctions.findPrevOccurance
Window._finishedSearch = mainWindowFunctions._finishedSearch
Window.showDeleteDialog = mainWindowFunctions.showDeleteDialog
Window._renameNote = mainWindowFunctions._renameNote
Window._addNote = mainWindowFunctions._addNote
Window._addNotebook = mainWindowFunctions._addNotebook
Window._addSubNotebook = mainWindowFunctions._addSubNotebook
Window.resizeEvent = mainWindowFunctions.resizeEvent
Window.openLoginDialog = mainWindowFunctions.openLoginDialog
Window.openFirstLoginDialog = mainWindowFunctions.openFirstLoginDialog
Window.checkFirstLogin = mainWindowFunctions.checkFirstLogin
Window.closeDialogAndMainWindow = mainWindowFunctions.closeDialogAndMainWindow
Window.encryptAlldecryptedNotes = mainWindowFunctions.encryptAlldecryptedNotes
Window.permenantDecrypt = mainWindowFunctions.permenantDecrypt
Window.changeEncryptionPassword = mainWindowFunctions.changeEncryptionPassword
Window._importMD = mainWindowFunctions._importMD
Window.createSettingsDialog = mainWindowFunctions.createSettingsDialog
Window.pluginConnections = mainWindowFunctions.pluginConnections
Window.loadSettings = mainWindowFunctions.loadSettings
Window.loadPlugSettings = mainWindowFunctions.loadPlugSettings
Window.loadAppearSettings = mainWindowFunctions.loadAppearSettings
Window.appearConnections = mainWindowFunctions.appearConnections
Window.setPlainTextEditFont = mainWindowFunctions.setPlainTextEditFont
Window.handleLinks = mainWindowFunctions.handleLinks
Window.analyzeLink = mainWindowFunctions.analyzeLink
Window.searchForFilename = mainWindowFunctions.searchForFilename
Window.searchInBooks = mainWindowFunctions.searchInBooks
Window.fixScrolling = mainWindowFunctions.fixScrolling
Window.encryptionSettings = mainWindowFunctions.encryptionSettings
Window._verifyUser = mainWindowFunctions._verifyUser
Window.encryptAllChoiceChanged = mainWindowFunctions.encryptAllChoiceChanged
Window.changeUserPasswordSettings = mainWindowFunctions.changeUserPasswordSettings
Window.changeUserPassword = mainWindowFunctions.changeUserPassword
Window.openEncryptionWithMenu = mainWindowFunctions.openEncryptionWithMenu
Window.openDecryptionWithMenu = mainWindowFunctions.openDecryptionWithMenu
Window.printingNote = mainWindowFunctions.printingNote
Window._printPreview = mainWindowFunctions._printPreview




Window._noteLoader = Application.mainWindowFunctions._noteLoader
Window.closeEvent = Application.mainWindowFunctions.closeEvent
Window.reloadUI = Application.mainWindowFunctions.reloadUI
Window.decryptNote = Application.mainWindowFunctions.decryptNote
Window.encryptNote = Application.mainWindowFunctions.encryptNote
Window._markdownViewer = Application.mainWindowFunctions._markdownViewer
Window._delayChecker = Application.mainWindowFunctions._delayChecker
Window.showMenu = Application.mainWindowFunctions.showMenu
Window.searchInNote = Application.mainWindowFunctions.searchInNote
Window.searchModeChanged = Application.mainWindowFunctions.searchModeChanged
Window.findNextOccurance = Application.mainWindowFunctions.findNextOccurance
Window.findPrevOccurance = Application.mainWindowFunctions.findPrevOccurance
Window._finishedSearch = Application.mainWindowFunctions._finishedSearch
Window.showDeleteDialog = Application.mainWindowFunctions.showDeleteDialog
Window._renameNote = Application.mainWindowFunctions._renameNote
Window._addNote = Application.mainWindowFunctions._addNote
Window._addNotebook = Application.mainWindowFunctions._addNotebook
Window._addSubNotebook = Application.mainWindowFunctions._addSubNotebook
Window.resizeEvent = Application.mainWindowFunctions.resizeEvent
Window.openLoginDialog = Application.mainWindowFunctions.openLoginDialog
Window.openFirstLoginDialog = Application.mainWindowFunctions.openFirstLoginDialog
Window.checkFirstLogin = Application.mainWindowFunctions.checkFirstLogin
Window.closeDialogAndMainWindow = Application.mainWindowFunctions.closeDialogAndMainWindow
Window.encryptAlldecryptedNotes = Application.mainWindowFunctions.encryptAlldecryptedNotes
Window.permenantDecrypt = Application.mainWindowFunctions.permenantDecrypt
Window.changeEncryptionPassword = Application.mainWindowFunctions.changeEncryptionPassword
Window._importMD = Application.mainWindowFunctions._importMD
Window.createSettingsDialog = Application.mainWindowFunctions.createSettingsDialog
Window.pluginConnections = Application.mainWindowFunctions.pluginConnections
Window.loadSettings = Application.mainWindowFunctions.loadSettings
Window.loadPlugSettings = Application.mainWindowFunctions.loadPlugSettings
Window.loadAppearSettings = Application.mainWindowFunctions.loadAppearSettings
Window.appearConnections = Application.mainWindowFunctions.appearConnections
Window.setPlainTextEditFont = Application.mainWindowFunctions.setPlainTextEditFont
Window.handleLinks = Application.mainWindowFunctions.handleLinks
Window.analyzeLink = Application.mainWindowFunctions.analyzeLink
Window.searchForFilename = Application.mainWindowFunctions.searchForFilename
Window.searchInBooks = Application.mainWindowFunctions.searchInBooks
Window.fixScrolling = Application.mainWindowFunctions.fixScrolling
Window.encryptionSettings = Application.mainWindowFunctions.encryptionSettings
Window._verifyUser = Application.mainWindowFunctions._verifyUser
Window.encryptAllChoiceChanged = Application.mainWindowFunctions.encryptAllChoiceChanged
Window.changeUserPasswordSettings = Application.mainWindowFunctions.changeUserPasswordSettings
Window.changeUserPassword = Application.mainWindowFunctions.changeUserPassword
Window.openEncryptionWithMenu = Application.mainWindowFunctions.openEncryptionWithMenu
Window.openDecryptionWithMenu = Application.mainWindowFunctions.openDecryptionWithMenu
Window.printingNote = Application.mainWindowFunctions.printingNote
Window._printPreview = Application.mainWindowFunctions._printPreview
Loading

0 comments on commit 28a4a41

Please sign in to comment.