Quickbend 1.0.2__tar.gz → 1.1.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Quickbend
3
- Version: 1.0.2
3
+ Version: 1.1.0
4
4
  Summary: an app to create glitchart using pyside6
5
5
  Author-email: Daniel Crutti <dancrutti@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "Quickbend"
7
- version = "1.0.2"
7
+ version = "1.1.0"
8
8
  description = "an app to create glitchart using pyside6"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -27,6 +27,7 @@ class MainWindow(QMainWindow):
27
27
  def __init__(self):
28
28
  # main class
29
29
  super().__init__()
30
+ self.current_file_path = None
30
31
 
31
32
  self.setWindowTitle("My App")
32
33
  layout = QVBoxLayout()
@@ -38,6 +39,7 @@ class MainWindow(QMainWindow):
38
39
 
39
40
  self.encoding_box = QComboBox()
40
41
  self.encoding_box.addItems(["alaw", "ulaw", "adpcm"])
42
+ self.encoding_box.currentTextChanged.connect(self.Render)
41
43
  self.encoding_box_label = QLabel("Select Encoding:")
42
44
  encoding_layout = QHBoxLayout()
43
45
 
@@ -47,6 +49,7 @@ class MainWindow(QMainWindow):
47
49
 
48
50
  self.xor_box = QComboBox()
49
51
  self.xor_box.addItems(["Off", "On"])
52
+ self.xor_box.currentTextChanged.connect(self.Render)
50
53
  self.xor_box_label = QLabel("Xor Mixing:")
51
54
  xor_layout = QHBoxLayout()
52
55
 
@@ -57,6 +60,7 @@ class MainWindow(QMainWindow):
57
60
  self.echo_time = QLineEdit()
58
61
  self.echo_time.setPlaceholderText("Enter a Number (Decimals Accepted)")
59
62
  self.echo_time.setInputMask("00.00;_")
63
+ self.echo_time.editingFinished.connect(self.Render)
60
64
  self.echo_time_label = QLabel("Echo Time (Leave blank for no echo):")
61
65
  echo_layout = QHBoxLayout()
62
66
 
@@ -66,8 +70,8 @@ class MainWindow(QMainWindow):
66
70
  layout.addLayout(echo_layout)
67
71
 
68
72
  # image from file selection
69
- self.image_preview = QLabel()
70
73
  asset_path = files("Quickbend").joinpath("placeholder.jpg")
74
+ self.image_preview = QLabel()
71
75
  self.original_pixmap = QPixmap(str(asset_path))
72
76
  layout.addWidget(self.image_preview)
73
77
 
@@ -95,25 +99,33 @@ class MainWindow(QMainWindow):
95
99
  # loads image from file dialog into pixmap of QLabel
96
100
  def LoadNewImage(self):
97
101
  path = browse_file()
98
- # gets paths for program cleanup later.
99
- global cleanup_paths
100
- cleanup_paths = path
101
- if self.xor_box.currentText() == "On":
102
- xor_flag = True
103
- else:
104
- xor_flag = False
105
102
  if path:
103
+ self.current_file_path = path
104
+
105
+ global cleanup_paths
106
+ if path not in cleanup_paths:
107
+ cleanup_paths.append(path)
108
+
109
+ self.Render()
110
+
111
+ def Render(self):
112
+ if self.current_file_path:
113
+ if self.xor_box.currentText() == "On":
114
+ xor_flag = True
115
+ else:
116
+ xor_flag = False
106
117
  try:
107
118
  delay_time = float(self.echo_time.text())
108
119
  except ValueError:
109
120
  delay_time = 0
110
121
  synced_files = databend(
111
- path,
122
+ self.current_file_path,
112
123
  "/tmp/mash.bmp",
113
124
  encoding=self.encoding_box.currentText(),
114
125
  use_xor=xor_flag,
115
126
  delay_time=delay_time,
116
127
  )
128
+ global cleanup_paths
117
129
  if synced_files:
118
130
  cleanup_paths.extend(synced_files)
119
131
  self.original_pixmap = QPixmap("/tmp/mash.bmp")
@@ -134,12 +146,16 @@ class MainWindow(QMainWindow):
134
146
  def cleanup():
135
147
  if os.path.exists("/tmp/mash.bmp"):
136
148
  os.remove("/tmp/mash.bmp")
137
- for file in cleanup_paths:
138
- if os.path.exists(file):
139
- os.remove(file)
140
149
 
150
+ for item in cleanup_paths:
151
+ if isinstance(item, (list, tuple)):
152
+ for sub_item in item:
153
+ if isinstance(sub_item, str) and os.path.exists(sub_item):
154
+ os.remove(sub_item)
155
+
156
+ elif isinstance(item, str) and os.path.exists(item):
157
+ os.remove(item)
141
158
 
142
- # open and show window
143
159
  def main():
144
160
  global app, window
145
161
  app = QApplication()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Quickbend
3
- Version: 1.0.2
3
+ Version: 1.1.0
4
4
  Summary: an app to create glitchart using pyside6
5
5
  Author-email: Daniel Crutti <dancrutti@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
File without changes
File without changes