Skip to content

Commit

Permalink
Catch $reprint IOError when no allowed.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
d-dd committed Oct 2, 2016
1 parent 66528a9 commit c1fe8f5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions connections/cytube/plugins/reprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ def _com_reprint(self, cy, username, args, source):
if rank < 2:
clog.debug('not enough rank for $reprint', syst)
return
with open('connections/cytube/plugins/loaders/allowed.cfg') as f:
allowed = f.read().lower().split()
if username.lower() not in allowed:
clog.debug('not in allowed.txt for $reprint', syst)
return
try:
with open('connections/cytube/plugins/loaders/allowed.cfg') as f:
allowed = f.read().lower().split()
except(IOError):
clog.error("Reprint cancelled - No allowed.txt found", syst)
return
if username.lower() not in allowed:
clog.debug('not in allowed.txt for $reprint', syst)
return
try:
if cy.reprint is False:
clog.debug('cy.reprint is False', syst)
Expand Down

0 comments on commit c1fe8f5

Please sign in to comment.