mirror of
https://github.com/gutosie/neoboot.git
synced 2025-11-02 12:25:46 +01:00
Update testinout
This commit is contained in:
@@ -3,46 +3,93 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from os import system
|
from os import system
|
||||||
import time
|
import time
|
||||||
import random
|
|
||||||
from Tools.Directories import fileExists, SCOPE_PLUGINS
|
from Tools.Directories import fileExists, SCOPE_PLUGINS
|
||||||
|
|
||||||
|
|
||||||
def getAccesDate():
|
def getAccesDate():
|
||||||
timego=''
|
timego=''
|
||||||
|
dana = getTestOutTime() # etc Nie! Szukana liczba jest wieksza!
|
||||||
|
strzal = getTestInTime() # tmp Nie! Szukana liczba jest mniejsza!
|
||||||
|
if strzal == dana:
|
||||||
|
timego='timeoff'
|
||||||
|
os.system('rm /usr/lib/periodon/.kodn; rm /usr/lib/periodon/.accessdate')
|
||||||
|
# echo "Gratulacje! Zgadles" > /tmp/time_finish;
|
||||||
|
elif strzal < dana:
|
||||||
|
timego='isaccess'
|
||||||
|
#os.system('echo "Nie! Szukana liczba jest wieksza!" > /tmp/time_ok')
|
||||||
|
else:
|
||||||
|
timego='timeoff'
|
||||||
|
os.system('rm /usr/lib/periodon/.kodn; rm /usr/lib/periodon/.accessdate')
|
||||||
|
#echo "Nie! Szukana liczba jest mniejsza!" > /tmp/time_finish;
|
||||||
return timego
|
return timego
|
||||||
|
|
||||||
|
|
||||||
def getTestCzas():
|
def getTestCzas():
|
||||||
mytestnC=''
|
mytestnC=''
|
||||||
|
if os.path.exists('/usr/lib/periodon/.accessdate'):
|
||||||
|
with open('/usr/lib/periodon/.accessdate', 'r') as f:
|
||||||
|
mytestnC = f.readline().strip()
|
||||||
|
f.close()
|
||||||
return mytestnC
|
return mytestnC
|
||||||
|
|
||||||
|
|
||||||
def getTestToTest():
|
def getTestToTest():
|
||||||
mytestnb=''
|
mytestnb=''
|
||||||
|
if os.path.exists('/tmp/.nkod'):
|
||||||
|
with open('/tmp/.nkod', 'r') as f:
|
||||||
|
mytestnb = f.readline().strip()
|
||||||
|
f.close()
|
||||||
return mytestnb
|
return mytestnb
|
||||||
|
|
||||||
|
|
||||||
def getTestIn():
|
def getTestIn():
|
||||||
neopluspro='UNKNOWN'
|
neopluspro='UNKNOWN'
|
||||||
|
if os.path.exists('/usr/lib/periodon/.kodn'):
|
||||||
|
with open('/usr/lib/periodon/.kodn', 'r') as f:
|
||||||
|
lines = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines.find('1234' + getTestToTest() + '') != -1:
|
||||||
|
neopluspro='1234%s' % getTestToTest()
|
||||||
return neopluspro
|
return neopluspro
|
||||||
|
|
||||||
|
|
||||||
def getTestOut():
|
def getTestOut():
|
||||||
neoplus='UNKNOWN'
|
neoplus='UNKNOWN'
|
||||||
|
if os.path.exists('/tmp/.nkod'):
|
||||||
|
with open('/tmp/.nkod', 'r') as f:
|
||||||
|
lines2 = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines2.find("%s" %getTestToTest()) != -1:
|
||||||
|
neoplus='1234%s' % getTestToTest()
|
||||||
return neoplus
|
return neoplus
|
||||||
|
|
||||||
|
|
||||||
def getAccessN():
|
def getAccessN():
|
||||||
neopro='UNKNOWN'
|
neopro='UNKNOWN'
|
||||||
|
if os.path.exists('/usr/lib/periodon/.kodn'):
|
||||||
|
with open('/usr/lib/periodon/.kodn', 'r') as f:
|
||||||
|
lines3 = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines3.find('1234') != -1:
|
||||||
|
neopro='1234'
|
||||||
|
elif not lines3.find('1234') != -1:
|
||||||
|
neopro='1235'
|
||||||
return neopro
|
return neopro
|
||||||
|
|
||||||
|
|
||||||
def getTestInTime():
|
def getTestInTime():
|
||||||
mydatein='UNKNOWN'
|
mydatein='UNKNOWN'
|
||||||
|
if os.path.exists('/tmp/.finishdate'):
|
||||||
|
with open('/tmp/.finishdate', 'r') as f:
|
||||||
|
mydatein = f.readline().strip()
|
||||||
|
f.close()
|
||||||
return mydatein
|
return mydatein
|
||||||
|
|
||||||
|
|
||||||
def getTestOutTime():
|
def getTestOutTime():
|
||||||
mydateout='UNKNOWN'
|
mydateout='UNKNOWN'
|
||||||
|
if os.path.exists('/usr/lib/periodon/.accessdate'):
|
||||||
|
with open('/usr/lib/periodon/.accessdate', 'r') as f:
|
||||||
|
mydateout = f.readline().strip()
|
||||||
|
f.close()
|
||||||
return mydateout
|
return mydateout
|
||||||
|
|||||||
Reference in New Issue
Block a user