icon and units
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
GROSS_WEIGHT,GROSS_TIME,TARE_WEIGHT,TARE_TIME,NET
|
||||
0,09/17/2025 06:12 PM,3780,09/17/2025 06:13 PM,-3780
|
||||
3780,09/17/2025 10:18 PM,3640,09/17/2025 10:19 PM,140
|
||||
1640,09/17/2025 10:19 PM,0,09/17/2025 10:20 PM,1640
|
||||
GROSS_WEIGHT,GROSS_UNITS,GROSS_TIME,TARE_WEIGHT,TARE_UNITS,TARE_TIME,NET,NET_UNITS
|
||||
0,lb,09/17/2025 06:12 PM,3780,lb,09/17/2025 06:13 PM,-3780,lb
|
||||
3780,lb,09/17/2025 10:18 PM,3640,lb,09/17/2025 10:19 PM,140,lb
|
||||
1640,lb,09/17/2025 10:19 PM,0,lb,09/17/2025 10:20 PM,1640,lb
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
WEIGHT,TIMESTAMP
|
||||
0,09/17/2025 06:12 PM
|
||||
3780,09/17/2025 06:13 PM
|
||||
3780,09/17/2025 10:18 PM
|
||||
3640,09/17/2025 10:19 PM
|
||||
1640,09/17/2025 10:19 PM
|
||||
0,09/17/2025 10:20 PM
|
||||
WEIGHT,UNITS,TIMESTAMP
|
||||
0,lb,09/17/2025 06:12 PM
|
||||
3780,lb,09/17/2025 06:13 PM
|
||||
3780,lb,09/17/2025 10:18 PM
|
||||
3640,lb,09/17/2025 10:19 PM
|
||||
1640,lb,09/17/2025 10:19 PM
|
||||
0,lb,09/17/2025 10:20 PM
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
pyinstaller --noconsole --noconfirm main.py
|
||||
pyinstaller --noconsole --noconfirm -i icon.ico main.py
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
'C:\\Users\\Thad\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-windowed.ico',
|
||||
['C:\\data\\git\\rslogger-merger\\icon.ico'],
|
||||
None,
|
||||
False,
|
||||
False,
|
||||
@@ -62,7 +62,7 @@
|
||||
[],
|
||||
False,
|
||||
False,
|
||||
1758197208,
|
||||
1758198359,
|
||||
[('runw.exe',
|
||||
'C:\\Users\\Thad\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\PyInstaller\\bootloader\\Windows-64bit-intel\\runw.exe',
|
||||
'EXECUTABLE')],
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,8 +18,8 @@ missing module named grp - imported by shutil (delayed, optional), tarfile (opti
|
||||
missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib._local (optional), subprocess (delayed, conditional, optional)
|
||||
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional)
|
||||
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional)
|
||||
missing module named 'collections.abc' - imported by traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level), tracemalloc (top-level)
|
||||
missing module named posix - imported by os (conditional, optional), posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional)
|
||||
missing module named 'collections.abc' - imported by tracemalloc (top-level), traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level)
|
||||
missing module named posix - imported by posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional)
|
||||
missing module named resource - imported by posix (top-level)
|
||||
missing module named _posixsubprocess - imported by subprocess (conditional)
|
||||
missing module named fcntl - imported by subprocess (optional)
|
||||
|
||||
BIN
dist/main/_internal/base_library.zip
vendored
BIN
dist/main/_internal/base_library.zip
vendored
Binary file not shown.
BIN
dist/main/main.exe
vendored
BIN
dist/main/main.exe
vendored
Binary file not shown.
21
main.py
21
main.py
@@ -18,9 +18,11 @@ def parse_logs(log_text):
|
||||
i += 1
|
||||
continue
|
||||
|
||||
match = re.match(r'^GROSS\s+(\d+)\s*lb$', line)
|
||||
# Updated regex to capture any units (lb, kg, g, etc.)
|
||||
match = re.match(r'^GROSS\s+(\d+)\s*([a-zA-Z]+)$', line)
|
||||
if match:
|
||||
weight = int(match.group(1))
|
||||
units = match.group(2)
|
||||
i += 2 # Skip to timestamp line
|
||||
if i < len(lines):
|
||||
ts_line = lines[i].strip()
|
||||
@@ -29,7 +31,7 @@ def parse_logs(log_text):
|
||||
try:
|
||||
dt = datetime.strptime(ts_line, '%I:%M %p %m/%d/%y')
|
||||
excel_ts = dt.strftime('%m/%d/%Y %I:%M %p')
|
||||
pairs.append((weight, excel_ts))
|
||||
pairs.append((weight, units, excel_ts))
|
||||
except ValueError:
|
||||
i += 1
|
||||
continue
|
||||
@@ -44,20 +46,21 @@ def parse_logs(log_text):
|
||||
def write_csv1(pairs, filename):
|
||||
with open(filename, 'w', newline='') as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(['WEIGHT', 'TIMESTAMP'])
|
||||
for weight, timestamp in pairs:
|
||||
writer.writerow([weight, timestamp])
|
||||
writer.writerow(['WEIGHT', 'UNITS', 'TIMESTAMP'])
|
||||
for weight, units, timestamp in pairs:
|
||||
writer.writerow([weight, units, timestamp])
|
||||
|
||||
def write_csv2(pairs, filename):
|
||||
with open(filename, 'w', newline='') as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(['GROSS_WEIGHT', 'GROSS_TIME', 'TARE_WEIGHT', 'TARE_TIME', 'NET'])
|
||||
writer.writerow(['GROSS_WEIGHT', 'GROSS_UNITS', 'GROSS_TIME', 'TARE_WEIGHT', 'TARE_UNITS', 'TARE_TIME', 'NET', 'NET_UNITS'])
|
||||
for j in range(0, len(pairs), 2):
|
||||
if j + 1 < len(pairs):
|
||||
gross_weight, gross_time = pairs[j]
|
||||
tare_weight, tare_time = pairs[j + 1]
|
||||
gross_weight, gross_units, gross_time = pairs[j]
|
||||
tare_weight, tare_units, tare_time = pairs[j + 1]
|
||||
net = gross_weight - tare_weight
|
||||
writer.writerow([gross_weight, gross_time, tare_weight, tare_time, net])
|
||||
# Use gross units for net (assuming consistent units within pairs)
|
||||
writer.writerow([gross_weight, gross_units, gross_time, tare_weight, tare_units, tare_time, net, gross_units])
|
||||
|
||||
def select_input_file():
|
||||
filename = filedialog.askopenfilename(filetypes=[("Text files", "*.txt"), ("All files", "*.*")])
|
||||
|
||||
@@ -32,6 +32,7 @@ exe = EXE(
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
icon=['icon.ico'],
|
||||
)
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
|
||||
Reference in New Issue
Block a user