Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #42

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Dev #42

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init_subclass__(cls, **kwargs):

DEBUG: bool = False
TESTING: bool = False
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR: str = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# BASE_DIR: str = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, BASE_DIR)
LOG_DIR: str = os.path.join(BASE_DIR, "logs")
os.makedirs(LOG_DIR, exist_ok=True)
Expand Down
8 changes: 2 additions & 6 deletions models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

from importlib import import_module
import logging
import os
import re
Expand All @@ -9,13 +8,9 @@
from typing import Any, ClassVar, Dict, List, Optional, TypedDict
from uuid import uuid4


import_module("utils.logger.init")

import sublime

from api import Simplenote

from .api import Simplenote
from .utils.decorator import class_property
from .utils.tree.redblacktree import rbtree as RedBlackTree

Expand Down Expand Up @@ -352,6 +347,7 @@ def get_note_from_filepath(view_absolute_filepath: str):


if __name__ == "__main__":
from importlib import import_module
from pprint import pprint

import_module("_config")
Expand Down
5 changes: 2 additions & 3 deletions operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import sublime

from gui import SIMPLENOTE_BASE_DIR, SIMPLENOTE_SETTINGS_FILE, _show_message, open_view, remove_status
from models import Note

from .gui import SIMPLENOTE_BASE_DIR, SIMPLENOTE_SETTINGS_FILE, _show_message, open_view, remove_status
from .models import Note
from .utils.patterns.singleton.base import Singleton


Expand Down
5 changes: 2 additions & 3 deletions simplenote.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
# https://www.sublimetext.com/docs/api_reference.html
import sublime

from gui import close_view, open_view
from models import SIMPLENOTE_NOTES_DIR, Note

from .gui import close_view, open_view
from .models import SIMPLENOTE_NOTES_DIR, Note
from .utils.patterns.singleton.base import Singleton


Expand Down
11 changes: 5 additions & 6 deletions simplenotecommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import sublime
import sublime_plugin

from gui import SIMPLENOTE_PACKAGE_DIR, SIMPLENOTE_SETTINGS_FILE, close_view, open_view, remove_status, show_message
from models import Note
from operations import NoteCreator, NoteDeleter, NotesIndicator, NoteUpdater, OperationManager
from simplenote import clear_orphaned_filepaths, on_note_changed
from .gui import SIMPLENOTE_BASE_DIR, SIMPLENOTE_SETTINGS_FILE, close_view, open_view, remove_status, show_message
from .models import Note
from .operations import NoteCreator, NoteDeleter, NotesIndicator, NoteUpdater, OperationManager
from .simplenote import clear_orphaned_filepaths, on_note_changed


__all__ = [
Expand Down Expand Up @@ -251,8 +251,7 @@ def start():
sync()
SIMPLENOTE_STARTED = True
else:
filepath = os.path.join(SIMPLENOTE_PACKAGE_DIR, SIMPLENOTE_SETTINGS_FILE)
sublime.active_window().open_file(filepath)
sublime.active_window().open_file(os.path.join(SIMPLENOTE_BASE_DIR, SIMPLENOTE_SETTINGS_FILE))
show_message("Simplenote: Please configure username/password")
sublime.set_timeout(remove_status, 2000)
SIMPLENOTE_STARTED = False
Expand Down