mirror of
https://github.com/1j01/textual-paint.git
synced 2024-09-11 15:56:03 +03:00
Convert to relative imports
It no longer runs except with `python -m src.textual_paint.paint`
This commit is contained in:
parent
c4c1572dac
commit
3364e11b5d
@ -7,6 +7,3 @@ __maintainer__ = "Isaiah Odhner"
|
||||
__email__ = "isaiahodhner@gmail.com"
|
||||
__version__ = "0.1.0"
|
||||
__license__ = "MIT"
|
||||
|
||||
# For relative imports to work in Python 3.6
|
||||
import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
@ -1,4 +1,5 @@
|
||||
from typing import Any, Callable
|
||||
|
||||
from rich.segment import Segment
|
||||
from rich.style import Style
|
||||
from textual import events
|
||||
@ -12,8 +13,9 @@ from textual.color import Color as Color
|
||||
from textual.widget import Widget
|
||||
from textual.widgets import Button, Input, Label
|
||||
from textual.containers import Container
|
||||
from localization.i18n import get as _
|
||||
from windows import DialogWindow
|
||||
|
||||
from .localization.i18n import get as _
|
||||
from .windows import DialogWindow
|
||||
|
||||
|
||||
# https://github.com/kouzhudong/win2k/blob/ce6323f76d5cd7d136b74427dad8f94ee4c389d2/trunk/private/shell/win16/comdlg/color.c#L38-L43
|
||||
|
@ -1,6 +1,7 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Iterable
|
||||
|
||||
from textual.widgets import DirectoryTree
|
||||
from textual.widgets._tree import TreeNode
|
||||
from textual.widgets._directory_tree import DirEntry
|
||||
|
@ -1,14 +1,16 @@
|
||||
import os
|
||||
from typing import Any, Callable
|
||||
|
||||
from textual.containers import Container
|
||||
from textual.widget import Widget
|
||||
from textual.widgets import Button, Input, Tree, Label
|
||||
from textual.containers import Horizontal
|
||||
from textual.widgets._directory_tree import DirEntry
|
||||
from textual.containers import Container
|
||||
from localization.i18n import get as _
|
||||
from windows import DialogWindow
|
||||
from enhanced_directory_tree import EnhancedDirectoryTree
|
||||
|
||||
from .localization.i18n import get as _
|
||||
from .windows import DialogWindow
|
||||
from .enhanced_directory_tree import EnhancedDirectoryTree
|
||||
|
||||
class FileDialogWindow(DialogWindow):
|
||||
"""A dialog window that lets the user select a file."""
|
||||
|
@ -57,7 +57,7 @@ from textual.widgets import Button, Static, TabPane, TabbedContent, Tree
|
||||
from textual.widgets.tree import TreeNode
|
||||
# from textual.css._style_properties import BorderDefinition
|
||||
|
||||
from launch_editor import launch_editor
|
||||
from .launch_editor import launch_editor
|
||||
|
||||
# Instrument style setting in order to link to the source code where inline styles are set.
|
||||
inline_style_call_stacks: dict[DOMNode, dict[str, list[inspect.FrameInfo]]] = {}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import re
|
||||
from typing import Any, Callable
|
||||
|
||||
from textual import events
|
||||
from textual.containers import Container
|
||||
from textual.reactive import var
|
||||
@ -7,7 +8,8 @@ from textual.widgets import Button, Static
|
||||
from textual.message import Message
|
||||
from textual.dom import NoScreen
|
||||
from rich.text import Text
|
||||
from localization.i18n import markup_hotkey, get_hotkey, get_direction
|
||||
|
||||
from .localization.i18n import markup_hotkey, get_hotkey, get_direction
|
||||
|
||||
def to_snake_case(name: str) -> str:
|
||||
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
|
||||
|
@ -36,15 +36,15 @@ from textual.color import Color, ColorParseError
|
||||
from PIL import Image, UnidentifiedImageError
|
||||
from pyfiglet import Figlet, FigletFont
|
||||
|
||||
from menus import MenuBar, Menu, MenuItem, Separator
|
||||
from inspector import Inspector
|
||||
from windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, get_warning_icon, get_question_icon
|
||||
from file_dialogs import SaveAsDialogWindow, OpenDialogWindow
|
||||
from edit_colors import EditColorsDialogWindow
|
||||
from localization.i18n import get as _, load_language, remove_hotkey
|
||||
from wallpaper import get_config_dir, set_wallpaper
|
||||
from .menus import MenuBar, Menu, MenuItem, Separator
|
||||
from .inspector import Inspector
|
||||
from .windows import Window, DialogWindow, CharacterSelectorDialogWindow, MessageBox, get_warning_icon, get_question_icon
|
||||
from .file_dialogs import SaveAsDialogWindow, OpenDialogWindow
|
||||
from .edit_colors import EditColorsDialogWindow
|
||||
from .localization.i18n import get as _, load_language, remove_hotkey
|
||||
from .wallpaper import get_config_dir, set_wallpaper
|
||||
|
||||
from __init__ import __version__
|
||||
from .__init__ import __version__
|
||||
|
||||
MAX_FILE_SIZE = 500000 # 500 KB
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import os
|
||||
from PIL import Image
|
||||
|
||||
from figlet_font_writer import FIGletFontWriter
|
||||
from .figlet_font_writer import FIGletFontWriter
|
||||
|
||||
block_char_lookup = {
|
||||
0x0: ' ',
|
||||
|
@ -1,5 +1,6 @@
|
||||
from typing import Any, Callable
|
||||
from typing_extensions import Self
|
||||
|
||||
from textual import events, on
|
||||
from textual.message import Message
|
||||
from textual.app import ComposeResult
|
||||
@ -10,7 +11,8 @@ from textual.widget import Widget
|
||||
from textual.widgets import Button, Static, DataTable
|
||||
from textual.containers import Container, Horizontal, Vertical
|
||||
from textual.css.query import NoMatches
|
||||
from localization.i18n import get as _
|
||||
|
||||
from .localization.i18n import get as _
|
||||
|
||||
class WindowTitleBar(Container):
|
||||
"""A title bar widget."""
|
||||
|
Loading…
Reference in New Issue
Block a user