diff --git a/app.py b/app.py index c9b01df..5861c15 100755 --- a/app.py +++ b/app.py @@ -1,12 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - # @Author: Bachir Soussi Chiadmi # @Date: 23-05-2017 # @Email: bachir@figureslibres.io # @Last modified by: bach -# @Last modified time: 21-04-2017 +# @Last modified time: 03-06-2017 # @License: GPL-V3 import sys diff --git a/classes/content.py b/classes/content.py index 491bb42..cb4a23f 100644 --- a/classes/content.py +++ b/classes/content.py @@ -1,6 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# @Author: Bachir Soussi Chiadmi +# @Date: 23-05-2017 +# @Email: bachir@figureslibres.io +# @Filename: content.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 + import os, re from PyQt5 import QtCore @@ -127,7 +135,6 @@ class SummaryList(QListWidget): # print('onItemActivated', item.data) self.parent.parent.editor.openFile(self.currentRow()) - class SummaryListWidgetItem(QListWidgetItem): def __init__(self,parent,data): super(SummaryListWidgetItem, self).__init__(parent) @@ -137,7 +144,6 @@ class SummaryListWidgetItem(QListWidgetItem): self.setText(data['title']) self.setToolTip(data['file']) - class SummaryActions(QWidget): def __init__(self,parent): super(SummaryActions, self).__init__(parent) @@ -253,11 +259,11 @@ class MarkdownEditor(QWidget): # self.tabs.setTabText(i, re.sub(r'^\*\s', '', self.tabs.tabText(i))) # TODO: how to combine file save and project save -# __ ___ _ -# / |/ /___ _(_)___ -# / /|_/ / __ `/ / __ \ -# / / / / /_/ / / / / / -# /_/ /_/\__,_/_/_/ /_/ +# _____ __ __ +# / ___// /_____ ______/ /__ +# \__ \/ __/ __ `/ ___/ //_/ +# ___/ / /_/ /_/ / /__/ ,< +# /____/\__/\__,_/\___/_/|_| class ContentStack(QWidget): def __init__(self, core): super(ContentStack, self).__init__() diff --git a/classes/core.py b/classes/core.py index 5e26f8e..4993269 100644 --- a/classes/core.py +++ b/classes/core.py @@ -1,12 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - # @Author: Bachir Soussi Chiadmi # @Date: 23-05-2017 # @Email: bachir@figureslibres.io # @Last modified by: bach -# @Last modified time: 21-04-2017 +# @Last modified time: 03-06-2017 # @License: GPL-V3 import os, re, shutil, tempfile diff --git a/classes/design.py b/classes/design.py index 5abaf84..7f718bd 100644 --- a/classes/design.py +++ b/classes/design.py @@ -1,6 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# @Author: Bachir Soussi Chiadmi +# @Date: 23-05-2017 +# @Email: bachir@figureslibres.io +# @Filename: design.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 + import os, re # sys, from PyQt5 import QtCore @@ -11,12 +19,14 @@ from PyQt5.QtWebKit import QWebSettings from PyQt5.QtWebKitWidgets import QWebView, QWebInspector from PyQt5.QtPrintSupport import QPrintPreviewDialog, QPrinter -# from pygments import highlight -# from pygments.lexers import * -# from pygments.formatter import Formatter from classes import highlighter +# _ __ __ _ ___ +# | | / /__ / /_| | / (_)__ _ __ +# | | /| / / _ \/ __ \ | / / / _ \ | /| / / +# | |/ |/ / __/ /_/ / |/ / / __/ |/ |/ / +# |__/|__/\___/_.___/|___/_/\___/|__/|__/ class WebkitView(QWebView): def __init__(self, parent, core): self.parent = parent @@ -79,6 +89,12 @@ class WebkitView(QWebView): def evaluateJS(self, command): self.page().mainFrame().evaluateJavaScript(command) +# ____ __ +# / _/___ _________ ___ _____/ /_____ _____ +# / // __ \/ ___/ __ \/ _ \/ ___/ __/ __ \/ ___/ +# _/ // / / (__ ) /_/ / __/ /__/ /_/ /_/ / / +# /___/_/ /_/____/ .___/\___/\___/\__/\____/_/ +# /_/ class WebkitInspector(QWebInspector): def __init__(self, parent, webkitview): super(WebkitInspector, self).__init__(parent) @@ -87,6 +103,11 @@ class WebkitInspector(QWebInspector): self.showMaximized() # TODO: webkitinspector is disappearing when chaging tabs +# ______ ______ +# /_ __/___ ____ / / __ )____ ______ +# / / / __ \/ __ \/ / __ / __ `/ ___/ +# / / / /_/ / /_/ / / /_/ / /_/ / / +# /_/ \____/\____/_/_____/\__,_/_/ class WebViewToolBar(QWidget): def __init__(self, parent): super(WebViewToolBar, self).__init__(parent) @@ -184,7 +205,11 @@ class WebViewToolBar(QWidget): print("onGenPDF") self.parent.webkitview.ongenPDF() - +# ______ ___ __ +# / ____/___/ (_) /_____ _____ +# / __/ / __ / / __/ __ \/ ___/ +# / /___/ /_/ / / /_/ /_/ / / +# /_____/\__,_/_/\__/\____/_/ class CodeEditor(QPlainTextEdit): def __init__(self, core, tabs, file, mode): super(CodeEditor, self).__init__() @@ -239,7 +264,6 @@ class CodeEditor(QPlainTextEdit): self.changed = False # TODO: how to combine file save and project save - class Editor(QWidget): def __init__(self, parent, core): super(Editor, self).__init__() @@ -266,6 +290,11 @@ class Editor(QWidget): self.scsstab.setText() self.jstab.setText() +# _____ __ __ +# / ___// /_____ ______/ /__ +# \__ \/ __/ __ `/ ___/ //_/ +# ___/ / /_/ /_/ / /__/ ,< +# /____/\__/\__,_/\___/_/|_| class DesignStack(QWidget): def __init__(self, core): super(DesignStack, self).__init__() diff --git a/classes/docsetdialog.py b/classes/docsetdialog.py index 58fd3e8..cf767ca 100644 --- a/classes/docsetdialog.py +++ b/classes/docsetdialog.py @@ -1,12 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - # @Author: Bachir Soussi Chiadmi # @Date: 23-05-2017 # @Email: bachir@figureslibres.io # @Last modified by: bach -# @Last modified time: 21-04-2017 +# @Last modified time: 03-06-2017 # @License: GPL-V3 import os diff --git a/classes/highlighter.py b/classes/highlighter.py index f25fbcc..c62b976 100644 --- a/classes/highlighter.py +++ b/classes/highlighter.py @@ -1,4 +1,17 @@ +#!/usr/bin/python # -*- coding: utf-8 -*- + +# @Author: Bachir Soussi Chiadmi +# @Date: 02-06-2017 +# @Email: bachir@figureslibres.io +# @Filename: highlighter.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 + +# TODO add link to the source + + import sys import re from PyQt5 import QtCore, QtGui @@ -25,9 +38,11 @@ class QFormatter(Formatter): Formatter.__init__(self) self.data=[] self.style = get_style_by_name(style) - self.linenos = linenos + # self.linenos = linenos + # styles = list(get_all_styles()) # print(styles) + # Create a dictionary of text styles, indexed # by pygments token names, containing QTextCharFormat # instances according to pygments' description @@ -114,19 +129,3 @@ class Highlighter(QtGui.QSyntaxHighlighter): # I may need to do something about this being called # too quickly. self.tstamp=time.time() - - -# if __name__ == "__main__": -# app = QtGui.QApplication(sys.argv) -# -# rst = QtGui.QPlainTextEdit() -# rst.setWindowTitle('reSt') -# hl=Highlighter(rst.document(),"rest") -# rst.show() -# -# python = QtGui.QPlainTextEdit() -# python.setWindowTitle('python') -# hl=Highlighter(python.document(),"python") -# python.show() -# -# sys.exit(app.exec_()) diff --git a/classes/mainwindow.py b/classes/mainwindow.py index 6ad2cc8..7ddb444 100644 --- a/classes/mainwindow.py +++ b/classes/mainwindow.py @@ -1,12 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - # @Author: Bachir Soussi Chiadmi # @Date: 23-05-2017 # @Email: bachir@figureslibres.io # @Last modified by: bach -# @Last modified time: 21-04-2017 +# @Last modified time: 03-06-2017 # @License: GPL-V3 import os @@ -37,6 +36,11 @@ class MainWindow(QMainWindow): self.show() + # __ ___ ____ + # / |/ /__ ____ __ __/ __ )____ ______ + # / /|_/ / _ \/ __ \/ / / / __ / __ `/ ___/ + # / / / / __/ / / / /_/ / /_/ / /_/ / / + # /_/ /_/\___/_/ /_/\__,_/_____/\__,_/_/ def initMenuBar(self): # menu bar bar = self.menuBar() @@ -228,13 +232,11 @@ class MainWindow(QMainWindow): else: self.core.quit() - def oneditmenutrigger(self, q): print(q.text()+" is triggered") if q.text() == "&Reload": self.designstack.webkitview.reload() - def onviewmenutrigger(self, q): print(q.text()+" is triggered") if q.text() == "&Design": @@ -244,7 +246,11 @@ class MainWindow(QMainWindow): elif q.text() == "&Version": self.mainstack.setCurrentIndex(2) - + # __ ___ _ _____ __ __ + # / |/ /___ _(_)___ / ___// /_____ ______/ /__ + # / /|_/ / __ `/ / __ \\__ \/ __/ __ `/ ___/ //_/ + # / / / / /_/ / / / / /__/ / /_/ /_/ / /__/ ,< + # /_/ /_/\__,_/_/_/ /_/____/\__/\__,_/\___/_/|_| def initMainStack(self): self.mainstack = QStackedWidget() diff --git a/classes/md2html.py b/classes/md2html.py index c23c97b..c3d061d 100644 --- a/classes/md2html.py +++ b/classes/md2html.py @@ -1,6 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# @Author: Bachir Soussi Chiadmi +# @Date: 23-05-2017 +# @Email: bachir@figureslibres.io +# @Filename: md2html.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 + import os import re from PyQt5.QtCore import QFileSystemWatcher @@ -99,12 +107,3 @@ class Compiler(): book_html_f = os.path.join(self.core.cwd,'index.html') with open(book_html_f, 'w') as fp: fp.write(template_dom.prettify()) - - - - - - - - - # diff --git a/classes/sasscompiler.py b/classes/sasscompiler.py index 088f3a0..fa1c11b 100644 --- a/classes/sasscompiler.py +++ b/classes/sasscompiler.py @@ -1,6 +1,15 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# @Author: Bachir Soussi Chiadmi +# @Date: 30-05-2017 +# @Email: bachir@figureslibres.io +# @Filename: sasscompiler.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 + + import os from PyQt5.QtCore import QFileSystemWatcher import sass diff --git a/classes/server.py b/classes/server.py index 3e305a8..e1c0d76 100644 --- a/classes/server.py +++ b/classes/server.py @@ -1,6 +1,13 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# @Author: Bachir Soussi Chiadmi +# @Date: 23-05-2017 +# @Email: bachir@figureslibres.io +# @Filename: server.py +# @Last modified by: bach +# @Last modified time: 03-06-2017 +# @License: GPL-V3 import sys, os from socket import socket @@ -8,9 +15,7 @@ import socketserver import http.server import threading - class Server(): - def __init__(self, parent): self.parent = parent