mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-24 15:59:42 +02:00
typo
This commit is contained in:
parent
0f3d823798
commit
06085a6368
2 changed files with 6 additions and 14 deletions
|
@ -65,12 +65,6 @@ THREADS = 4
|
||||||
|
|
||||||
### Setup & Usage
|
### Setup & Usage
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 pandora-box.py
|
|
||||||
```
|
|
||||||
|
|
||||||
> ⚠️ Run with sufficient privileges to access `/dev/sdX` and monitor udev events.
|
|
||||||
|
|
||||||
More details in the [installation guide](INSTALL.md).
|
More details in the [installation guide](INSTALL.md).
|
||||||
|
|
||||||
## Application States
|
## Application States
|
||||||
|
|
|
@ -100,7 +100,7 @@ class scanThread(threading.Thread):
|
||||||
|
|
||||||
def scan(self, file):
|
def scan(self, file):
|
||||||
global infected_files, scanned, file_count, f_used
|
global infected_files, scanned, file_count, f_used
|
||||||
logging.info(f"Start scan.")
|
logging.info(f'{"Start scan."}')
|
||||||
try:
|
try:
|
||||||
# get file information
|
# get file information
|
||||||
file_name = os.path.basename(file)
|
file_name = os.path.basename(file)
|
||||||
|
@ -116,12 +116,12 @@ class scanThread(threading.Thread):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
if isFakeScan:
|
if isFakeScan:
|
||||||
status = "SKIPPED"
|
status = "SKIPPED"
|
||||||
logging.info(f"Fake scan - skipped.")
|
logging.info(f'{"Fake scan - skipped."}')
|
||||||
else:
|
else:
|
||||||
# do not scan files bigger than 1G
|
# do not scan files bigger than 1G
|
||||||
if file_size > (1024 * 1024 * 1024):
|
if file_size > (1024 * 1024 * 1024):
|
||||||
status = "TOO BIG"
|
status = "TOO BIG"
|
||||||
logging.info(f"File too big.")
|
logging.info(f'{"File too big."}')
|
||||||
else:
|
else:
|
||||||
worker = self.pandora.submit_from_disk(
|
worker = self.pandora.submit_from_disk(
|
||||||
file, seed_expire=6000)
|
file, seed_expire=6000)
|
||||||
|
@ -198,7 +198,7 @@ class scanThread(threading.Thread):
|
||||||
f'error="{str(ex)}"',
|
f'error="{str(ex)}"',
|
||||||
exc_info=True)
|
exc_info=True)
|
||||||
|
|
||||||
logging.info(f"Start done.")
|
logging.info(f'{"Start done."}')
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
@ -508,9 +508,8 @@ def mount_device():
|
||||||
logging.error("folder /media/box does not exists")
|
logging.error("folder /media/box does not exists")
|
||||||
return None
|
return None
|
||||||
# Mount device
|
# Mount device
|
||||||
# os.system(f"pmount {device.device_node} /media/box >/dev/null 2>/dev/null")
|
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
subprocess.run(
|
||||||
["pmount", device.device_node, "/media/box"],
|
["pmount", device.device_node, "/media/box"],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
|
@ -545,9 +544,8 @@ def umount_device():
|
||||||
log("Sync partitions", flush=True)
|
log("Sync partitions", flush=True)
|
||||||
os.system("sync")
|
os.system("sync")
|
||||||
else:
|
else:
|
||||||
# os.system("pumount /media/box 2>/dev/null >/dev/null")
|
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
subprocess.run(
|
||||||
["pumount", "/media/box"],
|
["pumount", "/media/box"],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue