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
|
- name: code quality checkout
|
||||||
run: |
|
run: |
|
||||||
pip install pylint
|
pip install pylint
|
||||||
ls
|
ls main
|
||||||
pwd
|
pylint ./main/pandora-box.py
|
||||||
pylint ./pandora-box/pandora-box.py
|
|
||||||
|
|
||||||
|
|
|
@ -17,17 +17,19 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# 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 os
|
||||||
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
from curses import wrapper
|
||||||
|
from datetime import datetime
|
||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
from datetime import datetime
|
import curses
|
||||||
|
|
||||||
|
import pyudev
|
||||||
|
import psutil
|
||||||
|
|
||||||
|
import pypandora
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Config variables
|
# Config variables
|
||||||
|
@ -110,7 +112,7 @@ def waitMouseClick():
|
||||||
if (buf[0] & 0x1)==1:
|
if (buf[0] & 0x1)==1:
|
||||||
down = True
|
down = True
|
||||||
if ((buf[0] & 0x1)==0) and down:
|
if ((buf[0] & 0x1)==0) and down:
|
||||||
break;
|
break
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
@ -201,7 +203,7 @@ def update_bar(progress):
|
||||||
progress_win.refresh()
|
progress_win.refresh()
|
||||||
|
|
||||||
"""Splash screen"""
|
"""Splash screen"""
|
||||||
s = [None] * 10;
|
s = [None] * 10
|
||||||
s[0] = " ██▓███ ▄▄▄ ███▄ █ ▓█████▄ ▒█████ ██▀███ ▄▄▄ ▄▄▄▄ ▒█████ ▒██ ██▒"
|
s[0] = " ██▓███ ▄▄▄ ███▄ █ ▓█████▄ ▒█████ ██▀███ ▄▄▄ ▄▄▄▄ ▒█████ ▒██ ██▒"
|
||||||
s[1] = " ▓██░ ██▒▒████▄ ██ ▀█ █ ▒██▀ ██▌▒██▒ ██▒▓██ ▒ ██▒▒████▄ ▓█████▄ ▒██▒ ██▒▒▒ █ █ ▒░"
|
s[1] = " ▓██░ ██▒▒████▄ ██ ▀█ █ ▒██▀ ██▌▒██▒ ██▒▓██ ▒ ██▒▒████▄ ▓█████▄ ▒██▒ ██▒▒▒ █ █ ▒░"
|
||||||
s[2] = " ▓██░ ██▓▒▒██ ▀█▄ ▓██ ▀█ ██▒░██ █▌▒██░ ██▒▓██ ░▄█ ▒▒██ ▀█▄ ▒██▒ ▄██▒██░ ██▒░░ █ ░"
|
s[2] = " ▓██░ ██▓▒▒██ ▀█▄ ▓██ ▀█ ██▒░██ █▌▒██░ ██▒▓██ ░▄█ ▒▒██ ▀█▄ ▒██▒ ▄██▒██░ ██▒░░ █ ░"
|
||||||
|
@ -328,7 +330,7 @@ def mount_device():
|
||||||
except Exception as e :
|
except Exception as e :
|
||||||
loop +=1
|
loop +=1
|
||||||
continue
|
continue
|
||||||
break;
|
break
|
||||||
return "/media/box"
|
return "/media/box"
|
||||||
|
|
||||||
"""Unmount USB device"""
|
"""Unmount USB device"""
|
||||||
|
@ -492,7 +494,7 @@ def mount():
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
def scan_device():
|
def scan_device():
|
||||||
global mount_point, infected_files
|
global infected_files
|
||||||
try:
|
try:
|
||||||
statvfs=os.statvfs(mount_point)
|
statvfs=os.statvfs(mount_point)
|
||||||
except Exception as e :
|
except Exception as e :
|
||||||
|
@ -580,7 +582,7 @@ def loop(state):
|
||||||
def main():
|
def main():
|
||||||
try :
|
try :
|
||||||
state="START"
|
state="START"
|
||||||
while (state!="STOP"):
|
while state!="STOP":
|
||||||
state = loop(state)
|
state = loop(state)
|
||||||
except Exception as e :
|
except Exception as e :
|
||||||
log("error=%s" % e)
|
log("error=%s" % e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue