forked from Mirrors/apostrophe
use pep8 naming style for modules and classes
parent
c91d8018dc
commit
129041795a
|
@ -25,8 +25,8 @@ import gi
|
|||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk # pylint: disable=E0611
|
||||
|
||||
from uberwriter import UberwriterWindow
|
||||
from uberwriter import AppWindow
|
||||
from uberwriter import window
|
||||
from uberwriter import application
|
||||
from uberwriter.helpers import set_up_logging
|
||||
from uberwriter.uberwriterconfig import get_version
|
||||
|
||||
|
@ -36,7 +36,7 @@ def main():
|
|||
# (options, args) = parse_options()
|
||||
|
||||
# Run the application.
|
||||
app = AppWindow.Application()
|
||||
app = application.Application()
|
||||
|
||||
# ~ if args:
|
||||
# ~ for arg in args:
|
||||
|
|
|
@ -16,15 +16,15 @@ from gettext import gettext as _
|
|||
|
||||
import gi
|
||||
|
||||
from uberwriter.Theme import Theme
|
||||
|
||||
gi.require_version('Gtk', '3.0') # pylint: disable=wrong-import-position
|
||||
from gi.repository import GLib, Gio, Gtk, Gdk, GdkPixbuf
|
||||
|
||||
from uberwriter import UberwriterWindow
|
||||
from uberwriter.Settings import Settings
|
||||
from uberwriter import window
|
||||
from uberwriter.theme import Theme
|
||||
from uberwriter.settings import Settings
|
||||
from uberwriter.helpers import set_up_logging
|
||||
from uberwriter.PreferencesDialog import PreferencesDialog
|
||||
from uberwriter.preferences_dialog import PreferencesDialog
|
||||
from uberwriter.helpers import get_builder, get_media_path
|
||||
|
||||
|
||||
|
@ -168,7 +168,7 @@ class Application(Gtk.Application):
|
|||
# Windows are associated with the application
|
||||
# when the last one is closed the application shuts down
|
||||
# self.window = Window(application=self, title="UberWriter")
|
||||
self.window = UberwriterWindow.UberwriterWindow(self)
|
||||
self.window = window.Window(self)
|
||||
if self.args:
|
||||
self.window.load_file(self.args[0])
|
||||
if self.options.experimental_features:
|
||||
|
@ -303,10 +303,10 @@ class Application(Gtk.Application):
|
|||
self.window.copy_html_to_clipboard()
|
||||
|
||||
def on_preferences(self, _action, _value):
|
||||
PreferencesWindow = PreferencesDialog()
|
||||
PreferencesWindow.set_application(self)
|
||||
PreferencesWindow.set_transient_for(self.window)
|
||||
PreferencesWindow.show()
|
||||
preferences_window = PreferencesDialog()
|
||||
preferences_window.set_application(self)
|
||||
preferences_window.set_transient_for(self.window)
|
||||
preferences_window.show()
|
||||
|
||||
def on_quit(self, _action, _param):
|
||||
self.quit()
|
|
@ -36,7 +36,7 @@ class PressagioCallback(pressagio.callback.Callback):
|
|||
def future_stream(self):
|
||||
return ''
|
||||
|
||||
class UberwriterAutoCorrect:
|
||||
class AutoCorrect:
|
||||
|
||||
def show_bubble(self, iterator, suggestion):
|
||||
self.suggestion = suggestion
|
|
@ -25,12 +25,12 @@ import logging
|
|||
from gettext import gettext as _
|
||||
import gi
|
||||
|
||||
from uberwriter.Theme import Theme
|
||||
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
from uberwriter import helpers
|
||||
from uberwriter.theme import Theme
|
||||
from uberwriter.helpers import get_builder
|
||||
|
||||
LOGGER = logging.getLogger('uberwriter')
|
||||
|
@ -40,7 +40,7 @@ class Export:
|
|||
Manages all the export operations and dialogs
|
||||
"""
|
||||
|
||||
__gtype_name__ = "UberwriterExportDialog"
|
||||
__gtype_name__ = "export_dialog"
|
||||
|
||||
def __init__(self, filename):
|
||||
"""Set up the about dialog"""
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
from gettext import gettext as _
|
||||
|
||||
from uberwriter.MarkupBuffer import MarkupBuffer
|
||||
from uberwriter.markup_buffer import MarkupBuffer
|
||||
|
||||
|
||||
class FormatShortcuts():
|
|
@ -25,7 +25,7 @@ from gi.repository import Gtk
|
|||
from uberwriter.helpers import get_builder
|
||||
from uberwriter.helpers import get_descendant
|
||||
|
||||
from uberwriter.AppWindow import Application as app
|
||||
from uberwriter.application import Application as app
|
||||
|
||||
class MainHeaderbar: #pylint: disable=too-few-public-methods
|
||||
"""Sets up the main application headerbar
|
||||
|
|
|
@ -27,7 +27,7 @@ gi.require_version('Gtk', '3.0')
|
|||
from gi.repository import Gtk # pylint: disable=E0611
|
||||
|
||||
from uberwriter.uberwriterconfig import get_data_file
|
||||
from uberwriter.Builder import Builder
|
||||
from uberwriter.builder import Builder
|
||||
|
||||
|
||||
def get_builder(builder_file_name):
|
||||
|
|
|
@ -29,12 +29,12 @@ from gettext import gettext as _
|
|||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk, Gdk, GdkPixbuf, GObject
|
||||
from uberwriter import LatexToPNG
|
||||
from .Settings import Settings
|
||||
from uberwriter import latex_to_PNG
|
||||
from uberwriter.settings import Settings
|
||||
|
||||
from .FixTable import FixTable
|
||||
from uberwriter.fix_table import FixTable
|
||||
|
||||
from .MarkupBuffer import MarkupBuffer
|
||||
from uberwriter.markup_buffer import MarkupBuffer
|
||||
|
||||
LOGGER = logging.getLogger('uberwriter')
|
||||
|
||||
|
@ -264,12 +264,12 @@ def fill_lexikon_bubble(vocab, lexikon_dict):
|
|||
return None
|
||||
|
||||
|
||||
class UberwriterInlinePreview():
|
||||
class InlinePreview():
|
||||
|
||||
def __init__(self, view, text_buffer):
|
||||
self.text_view = view
|
||||
self.text_buffer = text_buffer
|
||||
self.latex_converter = LatexToPNG.LatexToPNG()
|
||||
self.latex_converter = latex_to_PNG.LatexToPNG()
|
||||
cursor_mark = self.text_buffer.get_insert()
|
||||
cursor_iter = self.text_buffer.get_iter_at_mark(cursor_mark)
|
||||
self.click_mark = self.text_buffer.create_mark('click', cursor_iter)
|
|
@ -23,7 +23,7 @@ from gi.repository import Gtk, Gdk
|
|||
|
||||
LOGGER = logging.getLogger('uberwriter')
|
||||
|
||||
class UberwriterSearchAndReplace():
|
||||
class SearchAndReplace():
|
||||
"""
|
||||
Adds (regex) search and replace functionality to
|
||||
uberwriter
|
|
@ -53,7 +53,7 @@ class Shelve():
|
|||
store.append(node[root], [filename, root + "/" + filename])
|
||||
|
||||
|
||||
class UberwriterSidebar():
|
||||
class Sidebar():
|
||||
"""
|
||||
Presentational class for shelves and files managed by the "sidebar"
|
||||
|
|
@ -48,7 +48,7 @@ A TextEditor is Gtk.TextView
|
|||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk, Gdk, GObject
|
||||
from .FormatShortcuts import FormatShortcuts
|
||||
from uberwriter.format_shortcuts import FormatShortcuts
|
||||
|
||||
import logging
|
||||
LOGGER = logging.getLogger('uberwriter')
|
|
@ -1,6 +1,6 @@
|
|||
from gi.repository import Gtk
|
||||
|
||||
from uberwriter.Settings import Settings
|
||||
from uberwriter.settings import Settings
|
||||
from uberwriter.helpers import get_css_path
|
||||
|
||||
|
|
@ -28,7 +28,6 @@ from gettext import gettext as _
|
|||
import gi
|
||||
from gi.repository.GObject import param_spec_string
|
||||
|
||||
from uberwriter.Theme import Theme
|
||||
|
||||
gi.require_version('Gtk', '3.0')
|
||||
gi.require_version('WebKit2', '4.0') # pylint: disable=wrong-import-position
|
||||
|
@ -41,18 +40,19 @@ import cairo
|
|||
|
||||
from uberwriter import headerbars
|
||||
from uberwriter import helpers
|
||||
from uberwriter.theme import Theme
|
||||
from uberwriter.helpers import get_builder
|
||||
from uberwriter.gtkspellcheck import SpellChecker
|
||||
|
||||
from .MarkupBuffer import MarkupBuffer
|
||||
from .UberwriterTextEditor import TextEditor
|
||||
from .UberwriterInlinePreview import UberwriterInlinePreview
|
||||
from .UberwriterSidebar import UberwriterSidebar
|
||||
from .UberwriterSearchAndReplace import UberwriterSearchAndReplace
|
||||
from .Settings import Settings
|
||||
# from .UberwriterAutoCorrect import UberwriterAutoCorrect
|
||||
from uberwriter.markup_buffer import MarkupBuffer
|
||||
from uberwriter.text_editor import TextEditor
|
||||
from uberwriter.inline_preview import InlinePreview
|
||||
from uberwriter.sidebar import Sidebar
|
||||
from uberwriter.search_and_replace import SearchAndReplace
|
||||
from uberwriter.settings import Settings
|
||||
# from .auto_correct import AutoCorrect
|
||||
|
||||
from .UberwriterExportDialog import Export
|
||||
from uberwriter.export_dialog import Export
|
||||
# from .plugins.bibtex import BibTex
|
||||
# Some Globals
|
||||
# TODO move them somewhere for better
|
||||
|
@ -65,7 +65,7 @@ CONFIG_PATH = os.path.expanduser("~/.config/uberwriter/")
|
|||
# See texteditor_lib.Window.py for more details about how this class works
|
||||
|
||||
|
||||
class UberwriterWindow(Gtk.ApplicationWindow):
|
||||
class Window(Gtk.ApplicationWindow):
|
||||
|
||||
WORDCOUNT = re.compile(r"(?!\-\w)[\s#*\+\-]+", re.UNICODE)
|
||||
|
||||
|
@ -219,7 +219,7 @@ class UberwriterWindow(Gtk.ApplicationWindow):
|
|||
# Events for Typewriter mode
|
||||
|
||||
# Setting up inline preview
|
||||
self.inline_preview = UberwriterInlinePreview(
|
||||
self.inline_preview = InlinePreview(
|
||||
self.text_editor, self.text_buffer)
|
||||
|
||||
# Vertical scrolling
|
||||
|
@ -236,14 +236,14 @@ class UberwriterWindow(Gtk.ApplicationWindow):
|
|||
###
|
||||
self.paned_window = self.builder.get_object("main_pained")
|
||||
self.sidebar_box = self.builder.get_object("sidebar_box")
|
||||
self.sidebar = UberwriterSidebar(self)
|
||||
self.sidebar = Sidebar(self)
|
||||
self.sidebar_box.hide()
|
||||
|
||||
###
|
||||
# Search and replace initialization
|
||||
# Same interface as Sidebar ;)
|
||||
###
|
||||
self.searchreplace = UberwriterSearchAndReplace(self)
|
||||
self.searchreplace = SearchAndReplace(self)
|
||||
|
||||
# Window resize
|
||||
self.window_resize(self)
|
||||
|
@ -1069,7 +1069,7 @@ class UberwriterWindow(Gtk.ApplicationWindow):
|
|||
"""
|
||||
pass
|
||||
# try:
|
||||
# self.auto_correct = UberwriterAutoCorrect(
|
||||
# self.auto_correct = AutoCorrect(
|
||||
# self.text_editor, self.text_buffer)
|
||||
# except:
|
||||
# LOGGER.debug("Couldn't install autocorrect.")
|
Loading…
Reference in New Issue