Skip to content

Commit

Permalink
Add .gitignore and add mode argument to xmlinfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-palmer committed Jul 6, 2020
1 parent a8d4893 commit cd42ab0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
*.bmp
10 changes: 5 additions & 5 deletions xmlinfo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ProgramError(Exception):


def get_info(ip_address, timeout, info, username, password):
# call -> CallInfo, line -> LineInfo, settings -> SettingsInfo
# call -> CallInfo, line -> LineInfo, settings -> SettingsInfo, mode -> ModeInfo
path = info[0].upper() + info[1:] + 'Info'

if username != '':
Expand Down Expand Up @@ -94,17 +94,17 @@ def main():
' -u, --username USERNAME authentication username\n'
' -p, --password PASSWORD authentication password\n'
'\n'
'INFO is one of either line, call or settings\n')
'INFO is one of either line, call, settings or mode\n')

return

if not len(arguments):
raise ProgramError(f'No ring-tone specified')
raise ProgramError(f'No mode specified')

info = arguments[0]

if info not in ('line', 'call', 'settings'):
raise ProgramError(f'Invalid info: info')
if info not in ('line', 'call', 'settings', 'mode'):
raise ProgramError(f'Invalid info: {info}')

if ip_address is None:
raise ProgramError('No -i/--ip option specified')
Expand Down

0 comments on commit cd42ab0

Please sign in to comment.