Skip to content

Commit

Permalink
Fix execution of examples without configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 3, 2018
1 parent 37e4cb4 commit 9d11600
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/batteryinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import sys

state_machine = gammu.StateMachine()
if len(sys.argv) >= 2:
if len(sys.argv) > 2:
state_machine.ReadConfig(Filename=sys.argv[1])
del sys.argv[1]
else:
Expand Down
2 changes: 1 addition & 1 deletion examples/dialvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
state_machine = gammu.StateMachine()

# Read the configuration (~/.gammurc or from command line)
if len(sys.argv) >= 2:
if len(sys.argv) > 2:
state_machine.ReadConfig(Filename=sys.argv[1])
del sys.argv[1]
else:
Expand Down
2 changes: 1 addition & 1 deletion examples/getdiverts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import sys

state_machine = gammu.StateMachine()
if len(sys.argv) >= 2:
if len(sys.argv) > 2:
state_machine.ReadConfig(Filename=sys.argv[1])
del sys.argv[1]
else:
Expand Down
2 changes: 1 addition & 1 deletion examples/sendlongsms.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
state_machine = gammu.StateMachine()

# Optionally load config file as defined by first parameter
if len(sys.argv) >= 2:
if len(sys.argv) > 2:
# Read the configuration from given file
state_machine.ReadConfig(Filename=sys.argv[1])
# Remove file name from args list
Expand Down
2 changes: 1 addition & 1 deletion examples/setdiverts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

state_machine = gammu.StateMachine()

if len(sys.argv) >= 2:
if len(sys.argv) > 2:
state_machine.ReadConfig(Filename=sys.argv[1])
del sys.argv[1]
else:
Expand Down

0 comments on commit 9d11600

Please sign in to comment.