mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-19 13:29:42 +02:00
code quality
This commit is contained in:
parent
d39d4b6d2f
commit
ad87e9c61f
2 changed files with 25 additions and 24 deletions
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
@ -26,7 +26,6 @@ jobs:
|
|||
- name: code quality checkout
|
||||
run: |
|
||||
pip install pylint
|
||||
ls
|
||||
pwd
|
||||
pylint ./pandora-box/pandora-box.py
|
||||
ls main
|
||||
pylint ./main/pandora-box.py
|
||||
|
||||
|
|
|
@ -17,17 +17,19 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import curses
|
||||
from curses import wrapper
|
||||
import pypandora
|
||||
import time
|
||||
import pyudev
|
||||
import psutil
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
from curses import wrapper
|
||||
from datetime import datetime
|
||||
import configparser
|
||||
import shutil
|
||||
from datetime import datetime
|
||||
import curses
|
||||
|
||||
import pyudev
|
||||
import psutil
|
||||
|
||||
import pypandora
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Config variables
|
||||
|
@ -110,7 +112,7 @@ def waitMouseClick():
|
|||
if (buf[0] & 0x1)==1:
|
||||
down = True
|
||||
if ((buf[0] & 0x1)==0) and down:
|
||||
break;
|
||||
break
|
||||
mouse.close()
|
||||
|
||||
# -----------------------------------------------------------
|
||||
|
@ -201,7 +203,7 @@ def update_bar(progress):
|
|||
progress_win.refresh()
|
||||
|
||||
"""Splash screen"""
|
||||
s = [None] * 10;
|
||||
s = [None] * 10
|
||||
s[0] = " ██▓███ ▄▄▄ ███▄ █ ▓█████▄ ▒█████ ██▀███ ▄▄▄ ▄▄▄▄ ▒█████ ▒██ ██▒"
|
||||
s[1] = " ▓██░ ██▒▒████▄ ██ ▀█ █ ▒██▀ ██▌▒██▒ ██▒▓██ ▒ ██▒▒████▄ ▓█████▄ ▒██▒ ██▒▒▒ █ █ ▒░"
|
||||
s[2] = " ▓██░ ██▓▒▒██ ▀█▄ ▓██ ▀█ ██▒░██ █▌▒██░ ██▒▓██ ░▄█ ▒▒██ ▀█▄ ▒██▒ ▄██▒██░ ██▒░░ █ ░"
|
||||
|
@ -328,7 +330,7 @@ def mount_device():
|
|||
except Exception as e :
|
||||
loop +=1
|
||||
continue
|
||||
break;
|
||||
break
|
||||
return "/media/box"
|
||||
|
||||
"""Unmount USB device"""
|
||||
|
@ -337,8 +339,8 @@ def umount_device():
|
|||
log("Sync partitions")
|
||||
res = os.system("sync")
|
||||
else:
|
||||
log("Unmount partitions")
|
||||
res = os.system("pumount /media/box 2>/dev/null >/dev/null")
|
||||
log("Unmount partitions")
|
||||
res = os.system("pumount /media/box 2>/dev/null >/dev/null")
|
||||
|
||||
def log_device_info(dev):
|
||||
logging.info(
|
||||
|
@ -394,7 +396,7 @@ def scan(mount_point, used):
|
|||
res = pandora.task_status(res["taskId"])
|
||||
status = res["status"]
|
||||
if status != "WAITING":
|
||||
break
|
||||
break
|
||||
time.sleep(0.5)
|
||||
loop += 1
|
||||
file_scan_end_time = time.time()
|
||||
|
@ -492,7 +494,7 @@ def mount():
|
|||
# --------------------------------------
|
||||
|
||||
def scan_device():
|
||||
global mount_point, infected_files
|
||||
global infected_files
|
||||
try:
|
||||
statvfs=os.statvfs(mount_point)
|
||||
except Exception as e :
|
||||
|
@ -580,11 +582,11 @@ def loop(state):
|
|||
def main():
|
||||
try :
|
||||
state="START"
|
||||
while (state!="STOP"):
|
||||
while state!="STOP":
|
||||
state = loop(state)
|
||||
except Exception as e :
|
||||
log("error=%s" % e)
|
||||
logging.info("An exception was thrown!", exc_info=True)
|
||||
log("error=%s" % e)
|
||||
logging.info("An exception was thrown!", exc_info=True)
|
||||
finally:
|
||||
end_curses()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue