diff --git a/.gitignore b/.gitignore index 95b6d2f..d5e4595 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ data/ui/shortcut_handlers .vscode/ *.glade~ dist/uberwriter-2.0b0-py3.7.egg +builddir/* diff --git a/setup.py b/setup.py index ded6cfc..8671284 100644 --- a/setup.py +++ b/setup.py @@ -60,10 +60,10 @@ setup( # "": '/opt/uberwriter/' }, packages=[ - "uberwriter_lib.gtkspellcheck", - "uberwriter_lib.pylocales", - # "uberwriter_lib.pressagio", - "uberwriter_lib", + "uberwriter.gtkspellcheck", + "uberwriter.pylocales", + # "uberwriter.pressagio", + "uberwriter", "uberwriter", "po" # "uberwriter.plugins" @@ -72,7 +72,7 @@ setup( include_package_data=True, package_data={ - 'uberwriter_lib.pylocales' : ['locales.db'], + 'uberwriter.pylocales' : ['locales.db'], }, data_files=[ (app_prefix + 'bin', ['bin/uberwriter']), diff --git a/uberwriter/.pylintrc b/uberwriter/.pylintrc index 2dc4fd2..8b0400e 100644 --- a/uberwriter/.pylintrc +++ b/uberwriter/.pylintrc @@ -60,7 +60,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -# disable=print-statement, +disable=print-statement, parameter-unpacking, unpacking-in-except, old-raise-syntax, diff --git a/uberwriter_lib/AppWindow.py b/uberwriter/AppWindow.py similarity index 97% rename from uberwriter_lib/AppWindow.py rename to uberwriter/AppWindow.py index f286761..bc39e88 100644 --- a/uberwriter_lib/AppWindow.py +++ b/uberwriter/AppWindow.py @@ -23,9 +23,9 @@ from gi.repository import GLib, Gio, Gtk, Gdk, GdkPixbuf from uberwriter import UberwriterWindow from uberwriter.Settings import Settings -from uberwriter_lib import set_up_logging -from uberwriter_lib.PreferencesDialog import PreferencesDialog -from . helpers import get_builder, get_media_path +from uberwriter.helpers import set_up_logging +from uberwriter.PreferencesDialog import PreferencesDialog +from uberwriter.helpers import get_builder, get_media_path class Application(Gtk.Application): @@ -181,7 +181,7 @@ class Application(Gtk.Application): parser = argparse.ArgumentParser() parser.add_argument( "-v", "--verbose", action="count", dest="verbose", - help=_("Show debug messages (-vv debugs uberwriter_lib also)")) + help=_("Show debug messages (-vv debugs uberwriter also)")) parser.add_argument( "-e", "--experimental-features", help=_("Use experimental features"), action='store_true' diff --git a/uberwriter_lib/Builder.py b/uberwriter/Builder.py similarity index 99% rename from uberwriter_lib/Builder.py rename to uberwriter/Builder.py index 123acd3..ec934aa 100644 --- a/uberwriter_lib/Builder.py +++ b/uberwriter/Builder.py @@ -28,7 +28,7 @@ import gi gi.require_version('Gtk', '3.0') # pylint: disable=wrong-import-position from gi.repository import GObject, Gtk # pylint: disable=E0611 -LOGGER = logging.getLogger('uberwriter_lib') +LOGGER = logging.getLogger('uberwriter') # this module is big so uses some conventional prefixes and postfixes # *s list, except self.widgets is a dictionary diff --git a/uberwriter/FormatShortcuts.py b/uberwriter/FormatShortcuts.py index ade4e01..d196ec6 100644 --- a/uberwriter/FormatShortcuts.py +++ b/uberwriter/FormatShortcuts.py @@ -17,7 +17,7 @@ from gettext import gettext as _ -from . MarkupBuffer import MarkupBuffer +from uberwriter.MarkupBuffer import MarkupBuffer class FormatShortcuts(): diff --git a/uberwriter_lib/LatexToPNG.py b/uberwriter/LatexToPNG.py similarity index 100% rename from uberwriter_lib/LatexToPNG.py rename to uberwriter/LatexToPNG.py diff --git a/uberwriter_lib/PreferencesDialog.py b/uberwriter/PreferencesDialog.py similarity index 92% rename from uberwriter_lib/PreferencesDialog.py rename to uberwriter/PreferencesDialog.py index bf07c0d..937dcf4 100644 --- a/uberwriter_lib/PreferencesDialog.py +++ b/uberwriter/PreferencesDialog.py @@ -22,9 +22,9 @@ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # pylint: disable=E0611 import logging -logger = logging.getLogger('uberwriter_lib') +logger = logging.getLogger('uberwriter') -from . helpers import get_builder, show_uri, get_help_uri +from uberwriter.helpers import get_builder, show_uri, get_help_uri class PreferencesDialog(Gtk.Window): __gtype_name__ = "PreferencesDialog" diff --git a/uberwriter/Theme.py b/uberwriter/Theme.py index cd408bc..0d925a8 100644 --- a/uberwriter/Theme.py +++ b/uberwriter/Theme.py @@ -1,7 +1,7 @@ from gi.repository import Gtk from uberwriter.Settings import Settings -from uberwriter_lib.helpers import get_css_path +from uberwriter.helpers import get_css_path class Theme: diff --git a/uberwriter/UberwriterAutoCorrect.py b/uberwriter/UberwriterAutoCorrect.py index d11eaea..003d03f 100644 --- a/uberwriter/UberwriterAutoCorrect.py +++ b/uberwriter/UberwriterAutoCorrect.py @@ -13,16 +13,16 @@ from gi.repository import Gtk, Gdk import enchant -from uberwriter_lib import pressagio -# import uberwriter_lib.pressagio.predictor -# import uberwriter_lib.pressagio.tokenizer -# import uberwriter_lib.pressagio.dbconnector -# import uberwriter_lib.pressagio.context_tracker -# import uberwriter_lib.pressagio.callback +from uberwriter import pressagio +# import uberwriter.pressagio.predictor +# import uberwriter.pressagio.tokenizer +# import uberwriter.pressagio.dbconnector +# import uberwriter.pressagio.context_tracker +# import uberwriter.pressagio.callback # from Levenshtein import distance -from uberwriter_lib.helpers import get_media_path +from uberwriter.helpers import get_media_path # Define and create PresageCallback object class PressagioCallback(pressagio.callback.Callback): diff --git a/uberwriter/UberwriterExportDialog.py b/uberwriter/UberwriterExportDialog.py index 167329a..7e17896 100644 --- a/uberwriter/UberwriterExportDialog.py +++ b/uberwriter/UberwriterExportDialog.py @@ -30,8 +30,8 @@ from uberwriter.Theme import Theme gi.require_version('Gtk', '3.0') from gi.repository import Gtk -from uberwriter_lib import helpers -from uberwriter_lib.helpers import get_builder +from uberwriter import helpers +from uberwriter.helpers import get_builder LOGGER = logging.getLogger('uberwriter') diff --git a/uberwriter/UberwriterInlinePreview.py b/uberwriter/UberwriterInlinePreview.py index 3ec7afd..f7ac7c4 100644 --- a/uberwriter/UberwriterInlinePreview.py +++ b/uberwriter/UberwriterInlinePreview.py @@ -29,7 +29,7 @@ from gettext import gettext as _ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GdkPixbuf, GObject -from uberwriter_lib import LatexToPNG +from uberwriter import LatexToPNG from .Settings import Settings from .FixTable import FixTable diff --git a/uberwriter/UberwriterWindow.py b/uberwriter/UberwriterWindow.py index 188e857..aa528e4 100644 --- a/uberwriter/UberwriterWindow.py +++ b/uberwriter/UberwriterWindow.py @@ -39,10 +39,10 @@ from gi.repository import Pango # pylint: disable=E0611 import cairo # import cairo.Pattern, cairo.SolidPattern -from . import headerbars -from uberwriter_lib import helpers -from uberwriter_lib.helpers import get_builder -from uberwriter_lib.gtkspellcheck import SpellChecker +from uberwriter import headerbars +from uberwriter import helpers +from uberwriter.helpers import get_builder +from uberwriter.gtkspellcheck import SpellChecker from .MarkupBuffer import MarkupBuffer from .UberwriterTextEditor import TextEditor diff --git a/uberwriter/__init__.py b/uberwriter/__init__.py index 75623c9..023ffb9 100644 --- a/uberwriter/__init__.py +++ b/uberwriter/__init__.py @@ -25,8 +25,11 @@ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # pylint: disable=E0611 -from . import UberwriterWindow -from uberwriter_lib import AppWindow +from uberwriter import UberwriterWindow +from uberwriter import AppWindow +from uberwriter.helpers import set_up_logging +from uberwriter.uberwriterconfig import get_version + def main(): 'constructor for your class instances' diff --git a/uberwriter_lib/gtkspellcheck/__init__.py b/uberwriter/gtkspellcheck/__init__.py similarity index 100% rename from uberwriter_lib/gtkspellcheck/__init__.py rename to uberwriter/gtkspellcheck/__init__.py diff --git a/uberwriter_lib/gtkspellcheck/oxt_extract.py b/uberwriter/gtkspellcheck/oxt_extract.py similarity index 100% rename from uberwriter_lib/gtkspellcheck/oxt_extract.py rename to uberwriter/gtkspellcheck/oxt_extract.py diff --git a/uberwriter_lib/gtkspellcheck/spellcheck.py b/uberwriter/gtkspellcheck/spellcheck.py similarity index 99% rename from uberwriter_lib/gtkspellcheck/spellcheck.py rename to uberwriter/gtkspellcheck/spellcheck.py index 4a296a6..0112fbf 100644 --- a/uberwriter_lib/gtkspellcheck/spellcheck.py +++ b/uberwriter/gtkspellcheck/spellcheck.py @@ -29,8 +29,8 @@ import logging import re import sys -from uberwriter_lib.pylocales import code_to_name as _code_to_name -from uberwriter_lib.pylocales import LanguageNotFound, CountryNotFound +from uberwriter.pylocales import code_to_name as _code_to_name +from uberwriter.pylocales import LanguageNotFound, CountryNotFound # public objects __all__ = ['SpellChecker', 'NoDictionariesFound', 'NoGtkBindingFound'] diff --git a/uberwriter/headerbars.py b/uberwriter/headerbars.py index 1ae1573..7434443 100644 --- a/uberwriter/headerbars.py +++ b/uberwriter/headerbars.py @@ -22,10 +22,10 @@ from gettext import gettext as _ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk -from uberwriter_lib.helpers import get_builder -from uberwriter_lib.helpers import get_descendant +from uberwriter.helpers import get_builder +from uberwriter.helpers import get_descendant -from uberwriter_lib.AppWindow import Application as app +from uberwriter.AppWindow import Application as app class MainHeaderbar: #pylint: disable=too-few-public-methods """Sets up the main application headerbar diff --git a/uberwriter_lib/helpers.py b/uberwriter/helpers.py similarity index 97% rename from uberwriter_lib/helpers.py rename to uberwriter/helpers.py index ec682ee..68288f2 100644 --- a/uberwriter_lib/helpers.py +++ b/uberwriter/helpers.py @@ -26,8 +26,8 @@ import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # pylint: disable=E0611 -from . uberwriterconfig import get_data_file -from . Builder import Builder +from uberwriter.uberwriterconfig import get_data_file +from uberwriter.Builder import Builder def get_builder(builder_file_name): @@ -103,7 +103,7 @@ def set_up_logging(opts): logger_sh.setFormatter(formatter) logger.addHandler(logger_sh) - lib_logger = logging.getLogger('uberwriter_lib') + lib_logger = logging.getLogger('uberwriter') lib_logger_sh = logging.StreamHandler() lib_logger_sh.setFormatter(formatter) lib_logger.addHandler(lib_logger_sh) diff --git a/uberwriter_lib/pressagio/VERSION b/uberwriter/pressagio/VERSION similarity index 100% rename from uberwriter_lib/pressagio/VERSION rename to uberwriter/pressagio/VERSION diff --git a/uberwriter_lib/pressagio/__init__.py b/uberwriter/pressagio/__init__.py similarity index 100% rename from uberwriter_lib/pressagio/__init__.py rename to uberwriter/pressagio/__init__.py diff --git a/uberwriter_lib/pressagio/callback.py b/uberwriter/pressagio/callback.py similarity index 100% rename from uberwriter_lib/pressagio/callback.py rename to uberwriter/pressagio/callback.py diff --git a/uberwriter_lib/pressagio/character.py b/uberwriter/pressagio/character.py similarity index 100% rename from uberwriter_lib/pressagio/character.py rename to uberwriter/pressagio/character.py diff --git a/uberwriter_lib/pressagio/combiner.py b/uberwriter/pressagio/combiner.py similarity index 100% rename from uberwriter_lib/pressagio/combiner.py rename to uberwriter/pressagio/combiner.py diff --git a/uberwriter_lib/pressagio/context_tracker.py b/uberwriter/pressagio/context_tracker.py similarity index 100% rename from uberwriter_lib/pressagio/context_tracker.py rename to uberwriter/pressagio/context_tracker.py diff --git a/uberwriter_lib/pressagio/dbconnector.py b/uberwriter/pressagio/dbconnector.py similarity index 100% rename from uberwriter_lib/pressagio/dbconnector.py rename to uberwriter/pressagio/dbconnector.py diff --git a/uberwriter_lib/pressagio/observer.py b/uberwriter/pressagio/observer.py similarity index 100% rename from uberwriter_lib/pressagio/observer.py rename to uberwriter/pressagio/observer.py diff --git a/uberwriter_lib/pressagio/predictor.py b/uberwriter/pressagio/predictor.py similarity index 100% rename from uberwriter_lib/pressagio/predictor.py rename to uberwriter/pressagio/predictor.py diff --git a/uberwriter_lib/pressagio/tests/__init__.py b/uberwriter/pressagio/tests/__init__.py similarity index 100% rename from uberwriter_lib/pressagio/tests/__init__.py rename to uberwriter/pressagio/tests/__init__.py diff --git a/uberwriter_lib/pressagio/tests/test_character.py b/uberwriter/pressagio/tests/test_character.py similarity index 100% rename from uberwriter_lib/pressagio/tests/test_character.py rename to uberwriter/pressagio/tests/test_character.py diff --git a/uberwriter_lib/pressagio/tests/test_combiner.py b/uberwriter/pressagio/tests/test_combiner.py similarity index 100% rename from uberwriter_lib/pressagio/tests/test_combiner.py rename to uberwriter/pressagio/tests/test_combiner.py diff --git a/uberwriter_lib/pressagio/tests/test_data/der_linksdenker.txt b/uberwriter/pressagio/tests/test_data/der_linksdenker.txt similarity index 100% rename from uberwriter_lib/pressagio/tests/test_data/der_linksdenker.txt rename to uberwriter/pressagio/tests/test_data/der_linksdenker.txt diff --git a/uberwriter_lib/pressagio/tests/test_data/profile_smoothedngram.ini b/uberwriter/pressagio/tests/test_data/profile_smoothedngram.ini similarity index 100% rename from uberwriter_lib/pressagio/tests/test_data/profile_smoothedngram.ini rename to uberwriter/pressagio/tests/test_data/profile_smoothedngram.ini diff --git a/uberwriter_lib/pressagio/tests/test_dbconnector.py b/uberwriter/pressagio/tests/test_dbconnector.py similarity index 100% rename from uberwriter_lib/pressagio/tests/test_dbconnector.py rename to uberwriter/pressagio/tests/test_dbconnector.py diff --git a/uberwriter_lib/pressagio/tests/test_predictor.py b/uberwriter/pressagio/tests/test_predictor.py similarity index 100% rename from uberwriter_lib/pressagio/tests/test_predictor.py rename to uberwriter/pressagio/tests/test_predictor.py diff --git a/uberwriter_lib/pressagio/tests/test_tokenizer.py b/uberwriter/pressagio/tests/test_tokenizer.py similarity index 100% rename from uberwriter_lib/pressagio/tests/test_tokenizer.py rename to uberwriter/pressagio/tests/test_tokenizer.py diff --git a/uberwriter_lib/pressagio/tokenizer.py b/uberwriter/pressagio/tokenizer.py similarity index 100% rename from uberwriter_lib/pressagio/tokenizer.py rename to uberwriter/pressagio/tokenizer.py diff --git a/uberwriter_lib/pylocales/__init__.py b/uberwriter/pylocales/__init__.py similarity index 100% rename from uberwriter_lib/pylocales/__init__.py rename to uberwriter/pylocales/__init__.py diff --git a/uberwriter_lib/pylocales/locales.db b/uberwriter/pylocales/locales.db similarity index 100% rename from uberwriter_lib/pylocales/locales.db rename to uberwriter/pylocales/locales.db diff --git a/uberwriter_lib/pylocales/locales.py b/uberwriter/pylocales/locales.py similarity index 100% rename from uberwriter_lib/pylocales/locales.py rename to uberwriter/pylocales/locales.py diff --git a/uberwriter_lib/tables.py b/uberwriter/tables.py similarity index 100% rename from uberwriter_lib/tables.py rename to uberwriter/tables.py diff --git a/uberwriter_lib/uberwriterconfig.py b/uberwriter/uberwriterconfig.py similarity index 97% rename from uberwriter_lib/uberwriterconfig.py rename to uberwriter/uberwriterconfig.py index 8765909..fc3f7b1 100644 --- a/uberwriter_lib/uberwriterconfig.py +++ b/uberwriter/uberwriterconfig.py @@ -47,7 +47,7 @@ def get_data_file(*path_segments): def get_data_path(): """Retrieve uberwriter data path - This path is by default /../data/ in trunk + This path is by default /../data/ in trunk and /opt/uberwriter/data in an installed version but this path is specified at installation time. """ diff --git a/uberwriter_lib/webkit2png/webkit2png.py b/uberwriter/webkit2png/webkit2png.py similarity index 100% rename from uberwriter_lib/webkit2png/webkit2png.py rename to uberwriter/webkit2png/webkit2png.py diff --git a/uberwriter_lib/.pylintrc b/uberwriter_lib/.pylintrc index 2dc4fd2..8b0400e 100644 --- a/uberwriter_lib/.pylintrc +++ b/uberwriter_lib/.pylintrc @@ -60,7 +60,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -# disable=print-statement, +disable=print-statement, parameter-unpacking, unpacking-in-except, old-raise-syntax, diff --git a/uberwriter_lib/__init__.py b/uberwriter_lib/__init__.py index 8bbd9d2..953d6b9 100644 --- a/uberwriter_lib/__init__.py +++ b/uberwriter_lib/__init__.py @@ -16,9 +16,9 @@ ### DO NOT EDIT THIS FILE ### -'''facade - makes uberwriter_lib package easy to refactor +'''facade - makes uberwriter package easy to refactor while keeping its api constant''' -from . helpers import set_up_logging -# from . AppWindow import Window -from . uberwriterconfig import get_version +from uberwriter.helpers import set_up_logging +# from uberwriter.AppWindow import Window +from uberwriter.uberwriterconfig import get_version