Commit 489f2565 authored by Markus's avatar Markus

fixed small problems, restructured a bit

parent 8c7c9fc6
......@@ -31,6 +31,8 @@ app_name = ('Hack-Space User Count')
if __name__ == '__main__':
###parser
parser = argparse.ArgumentParser(description='Access Peoplecounter in\
......@@ -113,27 +115,28 @@ if __name__ == '__main__':
if args.printing == True :
if args.show_user == False :
print ("HackHro Users: ",users.__len__())
else :
print ("HackHro Devcies: ",device_count)
try:
user_left_list
except NameError:
pass
else:
print ("Users left: ",end="",flush = True)
for user in user_left_list :
print (user['name']+" " ,end="",flush = True )
try:
user_new_list
except NameError :
pass
else :
print ("Users new: ",end="",flush = True )
for user in user_new_list :
print (user['name']+" ",end="",flush = True )
try:
user_left_list
except NameError:
pass
else:
print(user_left_list)
print ("Users left: ",end="")
for user in user_left_list :
print (user['name']+" " ,end="")
try:
user_new_list
except NameError :
pass
else :
print ("Users new: ",end="")
for user in user_new_list :
print (user['name']+" ",end="")
print ("HackHro Devcies: ",device_count,flush = True )
##notification
if args.notify and count_changed == True :
......@@ -142,6 +145,7 @@ if __name__ == '__main__':
notif = bus.get_object(item, path)
notify = dbus.Interface(notif, interface)
notification_string = ""
if args.show_user == False :
title = "HackSpace Users Changed"
try:
......@@ -172,6 +176,11 @@ if __name__ == '__main__':
count_changed = False
try:
del user_new_list
del user_left_list
except:
pass
if not args.daemonize == True :
sys.exit(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment