Skip to content
Snippets Groups Projects
Commit c943d7f1 authored by fejao's avatar fejao
Browse files

Merge branch 'Post_38c3_03' into 'main'

Adding example uploaded file at the system

See merge request !4
parents 5f1f49b2 f5514845
Branches
No related tags found
1 merge request!4Adding example uploaded file at the system
Pipeline #37310 passed
{"_default": {}} {"_default": {"1": {"file_code": "771-002-042", "uploaded_date": "2025-01-23_-_10-34-33", "original_name": "test_file_1.pdf", "new_file_name": "771-002-042___-___2025-01-23_-_10-34-33___-___test_file_1.pdf", "path": "/home/fejao/Coding/CCC/git_cccv/c3infodesk-printer/uploads/771-002-042___-___2025-01-23_-_10-34-33___-___test_file_1.pdf", "size": 9819, "num_pages": 1}}}
\ No newline at end of file \ No newline at end of file
...@@ -11,8 +11,8 @@ total = 0 ...@@ -11,8 +11,8 @@ total = 0
total = 1 total = 1
[FILES] [FILES]
total = 0 total = 1
[TOTAL_SIZE_UPLOAD] [TOTAL_SIZE_UPLOAD]
total = 0 total = 9819
...@@ -5,13 +5,16 @@ default: ...@@ -5,13 +5,16 @@ default:
### ###
### SET OWN PROPERTIES: BEGIN ### SET OWN PROPERTIES: BEGIN
### ###
### PRINTER USED ON 38c3
printer_name: 'HP_LaserJet_M402n'
# printer_name: 'EPSON_ET_2820_Series_USB@localhost' # printer_name: 'EPSON_ET_2820_Series_USB@localhost'
# printer_name: 'EPSON_ET-2820_Series' # printer_name: 'EPSON_ET-2820_Series'
printer_name: 'HP_LaserJet_M402n' ### LOCAL PATHS --> PLEASE CHANGE THIS
path_to_upload: "/home/fejao/Coding/CCC/Repos/c3infodesk/c3printer/uploads" path_to_upload: "/home/fejao/Coding/CCC/git_cccv/c3infodesk-printer/uploads"
path_to_log: "/home/fejao/Coding/CCC/Repos/c3infodesk/c3printer/logs/log_01.txt" path_to_log: "/home/fejao/Coding/CCC/git_cccv/c3infodesk-printer/logs/log_01.txt"
path_to_data: "/home/fejao/Coding/CCC/Repos/c3infodesk/c3printer/data" path_to_data: "/home/fejao/Coding/CCC/git_cccv/c3infodesk-printer/data"
path_to_test_file: "/home/fejao/Coding/CCC/Repos/c3infodesk/c3printer/src/tests/files/test_file.pdf" path_to_test_file: "/home/fejao/Coding/CCC/git_cccv/c3infodesk-printer/src/tests/files/test_file.pdf"
### ###
### SET OWN PROPERTIES: END ### SET OWN PROPERTIES: END
### ###
...@@ -76,8 +79,8 @@ default: ...@@ -76,8 +79,8 @@ default:
enabled_api: true enabled_api: true
# enabled_api: false # enabled_api: false
### INFLUXDB ### INFLUXDB
enabled_influxdb: true # enabled_influxdb: true
# enabled_influxdb: false enabled_influxdb: false
### FILE PREVIEW ### FILE PREVIEW
file_preview_width: '800' file_preview_width: '800'
file_preview_height: '900' file_preview_height: '900'
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
### ###
### DEPENDENCIES ### DEPENDENCIES
### ###
# import os
# import os.path
import sys import sys
import configparser import configparser
...@@ -159,7 +157,7 @@ class AppUsage(): ...@@ -159,7 +157,7 @@ class AppUsage():
int: int:
The total uploads. The total uploads.
""" """
logger("Fetched the counter for total uploads...") logger("Fetching the counter for total uploads...")
tot_uploads = None tot_uploads = None
if self.influxdb is None: if self.influxdb is None:
...@@ -179,7 +177,7 @@ class AppUsage(): ...@@ -179,7 +177,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Update the counter for total uploads...") logger("Updating the counter for total uploads...")
tot_uploads = self.counter_uploads_get() + 1 tot_uploads = self.counter_uploads_get() + 1
...@@ -201,7 +199,7 @@ class AppUsage(): ...@@ -201,7 +199,7 @@ class AppUsage():
int: int:
The total uploads. The total uploads.
""" """
logger("Fetched the counter for total files...") logger("Fetching the counter for total files...")
tot_files = None tot_files = None
if self.influxdb is None: if self.influxdb is None:
...@@ -221,7 +219,7 @@ class AppUsage(): ...@@ -221,7 +219,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Update the counter for total files...") logger("Updating the counter for total files...")
files_at_the_moment = self.counter_files_get() files_at_the_moment = self.counter_files_get()
...@@ -249,7 +247,7 @@ class AppUsage(): ...@@ -249,7 +247,7 @@ class AppUsage():
int: int:
The total prints. The total prints.
""" """
logger("Fetched the counter for total prints...") logger("Fetching the counter for total prints...")
tot_prints = None tot_prints = None
if self.influxdb is None: if self.influxdb is None:
...@@ -269,7 +267,7 @@ class AppUsage(): ...@@ -269,7 +267,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Updated the counter for total prints...") logger("Updating the counter for total prints...")
tot_prints = self.counter_prints_get() + 1 tot_prints = self.counter_prints_get() + 1
...@@ -291,7 +289,7 @@ class AppUsage(): ...@@ -291,7 +289,7 @@ class AppUsage():
int: int:
The total pages printed. The total pages printed.
""" """
logger("Fetched the counter for total pages...") logger("Fetching the counter for total pages...")
tot_pages = None tot_pages = None
if self.influxdb is None: if self.influxdb is None:
...@@ -311,7 +309,7 @@ class AppUsage(): ...@@ -311,7 +309,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Updated the counter for total pages...") logger("Updating the counter for total pages...")
tot_pages = self.counter_pages_get() + file_info.get('num_pages') tot_pages = self.counter_pages_get() + file_info.get('num_pages')
...@@ -333,7 +331,7 @@ class AppUsage(): ...@@ -333,7 +331,7 @@ class AppUsage():
int: int:
The maximal simultaneous uploads. The maximal simultaneous uploads.
""" """
logger("Fetched the counter for maximal simultaneous uploads...") logger("Fetching the counter for maximal simultaneous uploads...")
tot_simult_uploads = None tot_simult_uploads = None
if self.influxdb is None: if self.influxdb is None:
...@@ -353,7 +351,7 @@ class AppUsage(): ...@@ -353,7 +351,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Updated the counter for maximal simultaneous uploads...") logger("Updating the counter for maximal simultaneous uploads...")
# Get the total # Get the total
tot_simult = self.counter_max_simultaneous_uploaded_get() tot_simult = self.counter_max_simultaneous_uploaded_get()
...@@ -381,7 +379,7 @@ class AppUsage(): ...@@ -381,7 +379,7 @@ class AppUsage():
int: int:
The total size uploaded. The total size uploaded.
""" """
logger("Fetched the counter for total files uploaded size...") logger("Fetching the counter for total files uploaded size...")
tot_size = None tot_size = None
if self.influxdb is None: if self.influxdb is None:
...@@ -401,7 +399,7 @@ class AppUsage(): ...@@ -401,7 +399,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Updated the counter for total size uploaded...") logger("Updating the counter for total size uploaded...")
tot_size = self.counter_size_get() + file_info.get('size') tot_size = self.counter_size_get() + file_info.get('size')
...@@ -424,7 +422,7 @@ class AppUsage(): ...@@ -424,7 +422,7 @@ class AppUsage():
------- -------
None None
""" """
logger("Rotate the values on the InfluxDB...") logger("Rotating the values on the InfluxDB...")
### UPLOADS ### UPLOADS
tot_uploads = self.counter_uploads_get() tot_uploads = self.counter_uploads_get()
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment