[git fast commit] 25. Jun 2018 - 06:51:51

This commit is contained in:
Sheppy
2018-06-25 06:51:51 +02:00
parent c7b1fad816
commit 736952b8b0
3 changed files with 30 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ BATTERY_LOG = "battery.log"
IP_LOG = "ip.log"
LOGINS_LOG = "logins.log"
BC_WORD_LOG = "bc.log"
BC_PAGE_LOG = "bcp.log"
BATTERY_CRITICAL = 3 # in %
BAT_WARNING_STR = ">>>>>>>>>>>>>>>> ------------ WARNING BATTER FAILURE IMMINENT ------------ <<<<<<<<<<<<<"

View File

@@ -72,6 +72,12 @@ def bcw():
return hl_utils.color_panel(string,hl_utils.get_color(tmp,0,8000,reverse=False))
except:
return ""
def bwp():
try:
with open(hl_utils.hlpath(BC_PAGE_LOG),'r') as f:
return hl_utils.color_panel("{} pages".format(f.read().strip()),RED)
except:
return "lolwtf"
def countdown():
@@ -85,4 +91,4 @@ def countdown():
if __name__ == "__main__":
print(bcw(),countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')
print(bwp(),bcw(),countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')

View File

@@ -172,11 +172,30 @@ def pr_acct_status():
f.write(out)
def bc_words():
if hl_utils.is_cip():
with open(hl_utils.hlpath(BC_WORD_LOG),'w') as g:
tmp = hl_utils.shexec("wc -w /proj/cipdata/ik15ydit/license-confusion-bc/other_shit/lel.md")
tmp = hl_utils.shexec("wc -w {}".format(hl_utils.hlpath(".bctext",use_hostname=False)))
tmp = tmp.split()[0]
g.write(tmp)
def bc_pages():
hl_utils.shexec("pandoc {} -o {}".format(\
hl_utils.hlpath(".bctext",use_hostname=False),\
hl_utils.hlpath("test.pdf",use_hostname=False)))
arr = hl_utils.shexec("pdftk {} dump_data".format(\
hl_utils.hlpath("test.pdf",use_hostname=False)))
arr = arr.split("\n")
lol = "lolcannon"
for el in arr:
if "NumberOfPages" in el:
try:
with open(hl_utils.hlpath(BC_PAGE_LOG),'r') as f:
if int(f.read()) == int(el):
break
except:
pass
lol = el
break
with open(hl_utils.hlpath(BC_PAGE_LOG),"w") as g:
g.write(el.split()[1])
def vpn_status():
if not hl_utils.is_cip():
@@ -222,6 +241,7 @@ def save():
#cip_logins()
trace_login()
bc_words()
bc_pages()
def trace_login():
if hl_utils.is_cip():