mirror of
https://github.com/FAUSheppy/config
synced 2026-01-21 23:57:37 +01:00
[git fast commit] 03. Jul 2018 - 06:28:52
This commit is contained in:
@@ -172,30 +172,34 @@ def pr_acct_status():
|
||||
f.write(out)
|
||||
|
||||
def bc_words():
|
||||
try:
|
||||
with open(hl_utils.hlpath(BC_WORD_LOG),'w') as g:
|
||||
tmp = hl_utils.shexec("wc -w {}".format(hl_utils.hlpath(".bctext",use_hostname=False)))
|
||||
tmp = tmp.split()[0]
|
||||
g.write(tmp)
|
||||
tmp = len(hl_utils.shexec("pdftotext {} -".format(\
|
||||
hl_utils.hlpath(".bcpdf",use_hostname=False))).split(" "))
|
||||
g.write(str(tmp))
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
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])
|
||||
try:
|
||||
arr = hl_utils.shexec("pdftk {} dump_data".format(\
|
||||
hl_utils.hlpath(".bcpdf",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])
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
def vpn_status():
|
||||
if not hl_utils.is_cip():
|
||||
|
||||
Reference in New Issue
Block a user