2021-11-08 Fred Gleason <fredg@paravelsystems.com>

* Changed the name of the 'RivWebPyApi' to 'rivwebpyapi'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-11-08 11:47:52 -05:00
parent 2f0964dbf7
commit a1d0d5e44c
4 changed files with 17 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
# pypad.py
# rivwebpyapi.py
#
# Python binding for the Rivendell Web API
# Python3 binding for the Rivendell Web API
#
# (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
#
@@ -98,7 +98,7 @@ class RivWebPyApi_ListHandler(ContentHandler):
month=int(f0[1]),
day=int(f0[2]));
class RivWebPyApi(object):
class rivwebpyapi(object):
"""
Create a 'RivWebPyApi' object for accessing the Web API.
"""
@@ -201,7 +201,7 @@ class RivWebPyApi(object):
def ListServices(self,trackable):
"""
Returns a list of Rivendell services (Element).
Returns a list of Rivendell services (dictionary).
Takes one argument:

View File

@@ -38,9 +38,14 @@ recent=False
#
# Get login parameters
#
usage='list_logs --url=<rd-url> --username=<rd-username> [--password=<passwd>]'
usage='list_logs --url=<rd-url> --username=<rd-username> [--password=<passwd>] [--recent] [--trackable] [--service-name=<name>] [--log-name=<name>] [--filter-string=<str>]'
for arg in sys.argv:
f0=arg.split('=')
if(len(f0)==1):
if(f0[0]=='--recent'):
recent=True
if(f0[0]=='--trackable'):
trackable=True
if(len(f0)==2):
if(f0[0]=='--url'):
url=f0[1]
@@ -52,12 +57,8 @@ for arg in sys.argv:
service_name=f0[1]
if(f0[0]=='--log-name'):
log_name=f0[1]
if(f0[0]=='--trackable'):
trackable=True
if(f0[0]=='--filter-string'):
filter_string=f0[1]
if(f0[0]=='--recent'):
recent=True
if(not password):
password=getpass.getpass()
if((not url)or(not username)):
@@ -67,7 +68,7 @@ if((not url)or(not username)):
#
# Get the log list
#
webapi=rivwebpyapi.RivWebPyApi(url=url,username=username,password=password)
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
logs=webapi.ListLogs(service_name=service_name,log_name=log_name,
trackable=trackable,filter_string=filter_string,
recent=recent)

View File

@@ -36,6 +36,9 @@ password=''
trackable=False
for arg in sys.argv:
f0=arg.split('=')
if(len(f0)==1):
if(f0[0]=='--trackable'):
trackable=True
if(len(f0)==2):
if(f0[0]=='--url'):
url=f0[1]
@@ -43,8 +46,6 @@ for arg in sys.argv:
username=f0[1]
if(f0[0]=='--password'):
password=f0[1]
if(f0[0]=='--trackable'):
trackable=True
if(not password):
password=getpass.getpass()
if((not url)or(not username)):
@@ -54,7 +55,7 @@ if((not url)or(not username)):
#
# Get the services list
#
webapi=rivwebpyapi.RivWebPyApi(url=url,username=username,password=password)
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
services=webapi.ListServices(trackable=trackable)
#