Skip to content

Commit 1d8f105

Browse files
committedOct 4, 2017
Address linter issues in Travel/leapcard.1h.py
1 parent 91a8236 commit 1d8f105

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed
 

‎Travel/leapcard.1h.py

+14-22
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,19 @@
3030

3131

3232

33-
34-
33+
from sys import exit
3534

3635
# VERIFY DEPENDENCIES
37-
38-
def check_pyleapcard_installed():
39-
try:
40-
import pyleapcard
41-
except ImportError:
42-
print("Leap Card")
43-
print("---")
44-
print("Looks like the package 'pyleapcard' isn't installed.")
45-
print("You need it to run this tool. To install, click 'Install Now',")
46-
print("then click 'Preferences' -> 'Refresh All...'")
47-
print("Install Now. | bash='sudo /usr/local/bin/pip install pyleapcard'")
48-
exit()
49-
50-
check_pyleapcard_installed()
51-
52-
53-
36+
try:
37+
from pyleapcard import LeapSession
38+
except ImportError:
39+
print("Leap Card")
40+
print("---")
41+
print("Looks like the package 'pyleapcard' isn't installed.")
42+
print("You need it to run this tool. To install, click 'Install Now',")
43+
print("then click 'Preferences' -> 'Refresh All...'")
44+
print("Install Now. | bash='sudo /usr/local/bin/pip install pyleapcard'")
45+
exit()
5446

5547

5648

@@ -59,7 +51,7 @@ def check_pyleapcard_installed():
5951
import pickle
6052
import os
6153
import subprocess
62-
from pyleapcard import *
54+
import sys
6355

6456
class StateMgmt:
6557

@@ -160,8 +152,8 @@ def run():
160152

161153
try:
162154
login_ok = session.try_login(leap_user, leap_pass)
163-
except Exception, e:
164-
login_error = e = sys.exc_info()[0]
155+
except Exception:
156+
login_error = sys.exc_info()[0]
165157

166158
state = StateMgmt()
167159
formatter = ResultsFormatter()

0 commit comments

Comments
 (0)
Please sign in to comment.