Skip to content

Commit

Permalink
move scripts to top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkrives committed Feb 12, 2016
1 parent fb9b1e3 commit 1f6e92d
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions helpdesk-crew.py
@@ -0,0 +1,5 @@
from lib.get_shifts import get_shifts
import json

if __name__ == '__main__':
print(json.dumps(get_shifts()))
4 changes: 0 additions & 4 deletions lib/count_open_tickets.py
Expand Up @@ -5,7 +5,3 @@ def count_open_tickets():
open_tickets = get_tickets('open')
# awaiting_client_tickets = get_tickets('awaiting client')
return len(open_tickets) # + len(awaiting_client_tickets)


if __name__ == '__main__':
print(count_open_tickets())
3 changes: 0 additions & 3 deletions lib/count_unanswered_tickets.py
Expand Up @@ -25,6 +25,3 @@ def count_unanswered_tickets():
client_response = [t for t in tickets if is_client_response_ticket(t)]

return len(unanswered_tickets) + len(client_response)

if __name__ == '__main__':
print(count_unanswered_tickets())
3 changes: 0 additions & 3 deletions lib/get_shifts.py
Expand Up @@ -115,6 +115,3 @@ def get_shifts():
save_data(filename, data)
unlock_data(filename)
return load_data(filename)

if __name__ == '__main__':
print(get_shifts())
16 changes: 9 additions & 7 deletions printer-status.py
@@ -1,16 +1,18 @@
from lib.get_printers import check_printers, check_all_printers
from sys import argv
import json

if __name__ == '__main__':
if argv[0] == '--json':
json = True

def main():
if len(argv) > 1:
results = check_printers(argv[1:])
else:
results = check_all_printers()

for result in results:
print('%(name)s: %(error)s (%(toner)s%%)' % result)


if __name__ == '__main__':
main()
if not json:
for result in results:
print('%(name)s: %(error)s (%(toner)s%%)' % result)
else:
print(json.dumps(results))
Empty file removed scripts/helpdesk-crew.py
Empty file.
Empty file removed scripts/printer-status.py
Empty file.
Empty file removed scripts/total-tickets.py
Empty file.
Empty file removed scripts/unanswered-tickets.py
Empty file.
4 changes: 4 additions & 0 deletions total-tickets.py
@@ -0,0 +1,4 @@
from lib.count_open_tickets import count_open_tickets

if __name__ == '__main__':
print(count_open_tickets())
4 changes: 4 additions & 0 deletions unanswered-tickets.py
@@ -0,0 +1,4 @@
from lib.count_unanswered_tickets import count_unanswered_tickets

if __name__ == '__main__':
print(count_unanswered_tickets())
2 changes: 1 addition & 1 deletion widgets/helpdesk-crew.js
@@ -1,4 +1,4 @@
command: 'python3 scripts/helpdesk-crew.py',
command: 'python3 helpdesk-crew.py',
refreshFrequency: 10000,

style: [
Expand Down
2 changes: 1 addition & 1 deletion widgets/printer-status.js
@@ -1,4 +1,4 @@
command: 'python3 scripts/printer-status.py',
command: 'python3 printer-status.py',
refreshFrequency: 10000,

style: [
Expand Down
2 changes: 1 addition & 1 deletion widgets/total-tickets.js
@@ -1,4 +1,4 @@
command: 'python3 scripts/total-tickets.py',
command: 'python3 total-tickets.py',
refreshFrequency: 10000,

style: [
Expand Down
2 changes: 1 addition & 1 deletion widgets/unanswered-tickets.js
@@ -1,4 +1,4 @@
command: 'python3 scripts/unanswered-tickets.py',
command: 'python3 unanswered-tickets.py',
refreshFrequency: 10000,

style: [
Expand Down

0 comments on commit 1f6e92d

Please sign in to comment.