shinestacker 0.2.0.post1.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of shinestacker might be problematic. Click here for more details.
- shinestacker/__init__.py +3 -0
- shinestacker/_version.py +1 -0
- shinestacker/algorithms/__init__.py +14 -0
- shinestacker/algorithms/align.py +307 -0
- shinestacker/algorithms/balance.py +367 -0
- shinestacker/algorithms/core_utils.py +22 -0
- shinestacker/algorithms/depth_map.py +164 -0
- shinestacker/algorithms/exif.py +238 -0
- shinestacker/algorithms/multilayer.py +187 -0
- shinestacker/algorithms/noise_detection.py +182 -0
- shinestacker/algorithms/pyramid.py +176 -0
- shinestacker/algorithms/stack.py +112 -0
- shinestacker/algorithms/stack_framework.py +248 -0
- shinestacker/algorithms/utils.py +71 -0
- shinestacker/algorithms/vignetting.py +137 -0
- shinestacker/app/__init__.py +0 -0
- shinestacker/app/about_dialog.py +24 -0
- shinestacker/app/app_config.py +39 -0
- shinestacker/app/gui_utils.py +35 -0
- shinestacker/app/help_menu.py +16 -0
- shinestacker/app/main.py +176 -0
- shinestacker/app/open_frames.py +39 -0
- shinestacker/app/project.py +91 -0
- shinestacker/app/retouch.py +82 -0
- shinestacker/config/__init__.py +4 -0
- shinestacker/config/config.py +53 -0
- shinestacker/config/constants.py +174 -0
- shinestacker/config/gui_constants.py +85 -0
- shinestacker/core/__init__.py +5 -0
- shinestacker/core/colors.py +60 -0
- shinestacker/core/core_utils.py +52 -0
- shinestacker/core/exceptions.py +50 -0
- shinestacker/core/framework.py +210 -0
- shinestacker/core/logging.py +89 -0
- shinestacker/gui/__init__.py +0 -0
- shinestacker/gui/action_config.py +879 -0
- shinestacker/gui/actions_window.py +283 -0
- shinestacker/gui/colors.py +57 -0
- shinestacker/gui/gui_images.py +152 -0
- shinestacker/gui/gui_logging.py +213 -0
- shinestacker/gui/gui_run.py +393 -0
- shinestacker/gui/img/close-round-line-icon.png +0 -0
- shinestacker/gui/img/forward-button-icon.png +0 -0
- shinestacker/gui/img/play-button-round-icon.png +0 -0
- shinestacker/gui/img/plus-round-line-icon.png +0 -0
- shinestacker/gui/main_window.py +599 -0
- shinestacker/gui/new_project.py +170 -0
- shinestacker/gui/project_converter.py +148 -0
- shinestacker/gui/project_editor.py +539 -0
- shinestacker/gui/project_model.py +138 -0
- shinestacker/retouch/__init__.py +0 -0
- shinestacker/retouch/brush.py +9 -0
- shinestacker/retouch/brush_controller.py +57 -0
- shinestacker/retouch/brush_preview.py +126 -0
- shinestacker/retouch/exif_data.py +65 -0
- shinestacker/retouch/file_loader.py +104 -0
- shinestacker/retouch/image_editor.py +651 -0
- shinestacker/retouch/image_editor_ui.py +380 -0
- shinestacker/retouch/image_viewer.py +356 -0
- shinestacker/retouch/shortcuts_help.py +98 -0
- shinestacker/retouch/undo_manager.py +38 -0
- shinestacker-0.2.0.post1.dev1.dist-info/METADATA +55 -0
- shinestacker-0.2.0.post1.dev1.dist-info/RECORD +67 -0
- shinestacker-0.2.0.post1.dev1.dist-info/WHEEL +5 -0
- shinestacker-0.2.0.post1.dev1.dist-info/entry_points.txt +4 -0
- shinestacker-0.2.0.post1.dev1.dist-info/licenses/LICENSE +1 -0
- shinestacker-0.2.0.post1.dev1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import datetime
|
|
5
|
+
from .. config.config import config
|
|
6
|
+
from .. config.constants import constants
|
|
7
|
+
from .core_utils import get_app_base_path
|
|
8
|
+
if not config.DISABLE_TQDM:
|
|
9
|
+
from tqdm import tqdm
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ConsoleFormatter(logging.Formatter):
|
|
13
|
+
COLORS = {
|
|
14
|
+
'DEBUG': '\033[36m', # CYAN
|
|
15
|
+
'INFO': '\033[32m', # GREEN
|
|
16
|
+
'WARNING': '\033[33m', # YELLOW
|
|
17
|
+
'ERROR': '\033[31m', # RED
|
|
18
|
+
'CRITICAL': '\033[31;1m' # BOLD RED
|
|
19
|
+
}
|
|
20
|
+
RESET = '\033[0m'
|
|
21
|
+
|
|
22
|
+
def format(self, record):
|
|
23
|
+
color = self.COLORS.get(record.levelname, '')
|
|
24
|
+
return logging.Formatter(f"{color}[%(levelname).3s]{self.RESET} %(message)s").format(record)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class FileFormatter(logging.Formatter):
|
|
28
|
+
def format(self, record):
|
|
29
|
+
fmt = f"[%(levelname).3s %(asctime)s] %(message)s" # noqa
|
|
30
|
+
return constants.ANSI_ESCAPE.sub('', logging.Formatter(fmt).format(record).replace("\r", "").rstrip())
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class TqdmLoggingHandler(logging.StreamHandler):
|
|
34
|
+
def emit(self, record):
|
|
35
|
+
if not config.DISABLE_TQDM:
|
|
36
|
+
try:
|
|
37
|
+
tqdm.write(self.format(record), end=self.terminator)
|
|
38
|
+
except RecursionError:
|
|
39
|
+
raise
|
|
40
|
+
except Exception:
|
|
41
|
+
self.handleError(record)
|
|
42
|
+
else:
|
|
43
|
+
logging.StreamHandler.emit(self, record)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def setup_logging(console_level=logging.INFO, file_level=logging.DEBUG, log_file='',
|
|
47
|
+
disable_console=False):
|
|
48
|
+
if hasattr(setup_logging, '_called'):
|
|
49
|
+
return
|
|
50
|
+
setup_logging._called = True
|
|
51
|
+
root_logger = logging.getLogger()
|
|
52
|
+
root_logger.setLevel(logging.DEBUG)
|
|
53
|
+
if not disable_console:
|
|
54
|
+
console_handler = logging.StreamHandler(sys.stdout)
|
|
55
|
+
console_handler.setLevel(console_level)
|
|
56
|
+
console_handler.setFormatter(ConsoleFormatter())
|
|
57
|
+
root_logger.addHandler(console_handler)
|
|
58
|
+
tqdm_logger = logging.getLogger("tqdm")
|
|
59
|
+
tqdm_handler = TqdmLoggingHandler()
|
|
60
|
+
tqdm_handler.setFormatter(ConsoleFormatter())
|
|
61
|
+
tqdm_logger.handlers.clear()
|
|
62
|
+
tqdm_logger.addHandler(tqdm_handler)
|
|
63
|
+
tqdm_logger.propagate = False
|
|
64
|
+
if log_file is not None:
|
|
65
|
+
if log_file == '':
|
|
66
|
+
today = datetime.date.today().strftime("%Y-%m-%d")
|
|
67
|
+
log_file = f"logs/{constants.APP_STRING.lower()}-{today}.log"
|
|
68
|
+
if log_file[0] != '/':
|
|
69
|
+
log_file = f'{get_app_base_path()}/{log_file}'
|
|
70
|
+
Path(log_file).parent.mkdir(parents=True, exist_ok=True)
|
|
71
|
+
file_handler = logging.FileHandler(log_file)
|
|
72
|
+
file_handler.setLevel(file_level)
|
|
73
|
+
file_handler.setFormatter(FileFormatter())
|
|
74
|
+
root_logger.addHandler(file_handler)
|
|
75
|
+
tqdm_logger.addHandler(file_handler)
|
|
76
|
+
logging.getLogger("matplotlib").setLevel(logging.WARNING)
|
|
77
|
+
logging.getLogger("PIL").setLevel(logging.INFO)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def set_console_logging_terminator(terminator, name=None):
|
|
81
|
+
logging.getLogger(name).handlers[0].terminator = terminator
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def console_logging_overwrite(name=None):
|
|
85
|
+
set_console_logging_terminator('\r', name)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def console_logging_newline(name=None):
|
|
89
|
+
set_console_logging_terminator('\n', name)
|
|
File without changes
|