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.

Files changed (67) hide show
  1. shinestacker/__init__.py +3 -0
  2. shinestacker/_version.py +1 -0
  3. shinestacker/algorithms/__init__.py +14 -0
  4. shinestacker/algorithms/align.py +307 -0
  5. shinestacker/algorithms/balance.py +367 -0
  6. shinestacker/algorithms/core_utils.py +22 -0
  7. shinestacker/algorithms/depth_map.py +164 -0
  8. shinestacker/algorithms/exif.py +238 -0
  9. shinestacker/algorithms/multilayer.py +187 -0
  10. shinestacker/algorithms/noise_detection.py +182 -0
  11. shinestacker/algorithms/pyramid.py +176 -0
  12. shinestacker/algorithms/stack.py +112 -0
  13. shinestacker/algorithms/stack_framework.py +248 -0
  14. shinestacker/algorithms/utils.py +71 -0
  15. shinestacker/algorithms/vignetting.py +137 -0
  16. shinestacker/app/__init__.py +0 -0
  17. shinestacker/app/about_dialog.py +24 -0
  18. shinestacker/app/app_config.py +39 -0
  19. shinestacker/app/gui_utils.py +35 -0
  20. shinestacker/app/help_menu.py +16 -0
  21. shinestacker/app/main.py +176 -0
  22. shinestacker/app/open_frames.py +39 -0
  23. shinestacker/app/project.py +91 -0
  24. shinestacker/app/retouch.py +82 -0
  25. shinestacker/config/__init__.py +4 -0
  26. shinestacker/config/config.py +53 -0
  27. shinestacker/config/constants.py +174 -0
  28. shinestacker/config/gui_constants.py +85 -0
  29. shinestacker/core/__init__.py +5 -0
  30. shinestacker/core/colors.py +60 -0
  31. shinestacker/core/core_utils.py +52 -0
  32. shinestacker/core/exceptions.py +50 -0
  33. shinestacker/core/framework.py +210 -0
  34. shinestacker/core/logging.py +89 -0
  35. shinestacker/gui/__init__.py +0 -0
  36. shinestacker/gui/action_config.py +879 -0
  37. shinestacker/gui/actions_window.py +283 -0
  38. shinestacker/gui/colors.py +57 -0
  39. shinestacker/gui/gui_images.py +152 -0
  40. shinestacker/gui/gui_logging.py +213 -0
  41. shinestacker/gui/gui_run.py +393 -0
  42. shinestacker/gui/img/close-round-line-icon.png +0 -0
  43. shinestacker/gui/img/forward-button-icon.png +0 -0
  44. shinestacker/gui/img/play-button-round-icon.png +0 -0
  45. shinestacker/gui/img/plus-round-line-icon.png +0 -0
  46. shinestacker/gui/main_window.py +599 -0
  47. shinestacker/gui/new_project.py +170 -0
  48. shinestacker/gui/project_converter.py +148 -0
  49. shinestacker/gui/project_editor.py +539 -0
  50. shinestacker/gui/project_model.py +138 -0
  51. shinestacker/retouch/__init__.py +0 -0
  52. shinestacker/retouch/brush.py +9 -0
  53. shinestacker/retouch/brush_controller.py +57 -0
  54. shinestacker/retouch/brush_preview.py +126 -0
  55. shinestacker/retouch/exif_data.py +65 -0
  56. shinestacker/retouch/file_loader.py +104 -0
  57. shinestacker/retouch/image_editor.py +651 -0
  58. shinestacker/retouch/image_editor_ui.py +380 -0
  59. shinestacker/retouch/image_viewer.py +356 -0
  60. shinestacker/retouch/shortcuts_help.py +98 -0
  61. shinestacker/retouch/undo_manager.py +38 -0
  62. shinestacker-0.2.0.post1.dev1.dist-info/METADATA +55 -0
  63. shinestacker-0.2.0.post1.dev1.dist-info/RECORD +67 -0
  64. shinestacker-0.2.0.post1.dev1.dist-info/WHEEL +5 -0
  65. shinestacker-0.2.0.post1.dev1.dist-info/entry_points.txt +4 -0
  66. shinestacker-0.2.0.post1.dev1.dist-info/licenses/LICENSE +1 -0
  67. 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