diff --git a/CloudlogOffline2QRZ.py b/CloudlogOffline2QRZ.py index e5458b4..911c3a2 100644 --- a/CloudlogOffline2QRZ.py +++ b/CloudlogOffline2QRZ.py @@ -46,7 +46,8 @@ class QRZ(): 'api_key': '1234-ABCD-1234-A1B2', 'url': 'https://logbook.qrz.com/api'} config['general'] = { - 'api_key': 'API_KEY_FOR_THIS_API' + 'api_key': 'API_KEY_FOR_THIS_API', + 'install_path': '/log/' } with open(file_name, 'w') as configfile: @@ -122,6 +123,8 @@ class QRZ(): class ApiTest(Resource): + """Listens on the API endpoint /api/auth to validate + the configured API key in CloudlogOffline""" def get(self, key): if key and key == qrz.config['general']['api_key']: @@ -132,6 +135,8 @@ class ApiTest(Resource): class UploadQso(Resource): + """Listens on the API endpoint /api/qso to receive + single ADIF strings from CloudlogOffline""" def post(self): data = request.json @@ -154,12 +159,9 @@ class UploadQso(Resource): ) -# adding the defined resources along with their corresponding urls -api.add_resource(ApiTest, '/index.php/api/auth/' ) -api.add_resource(UploadQso, '/index.php/api/qso') - - -# driver function +# main if __name__ == '__main__': qrz = QRZ() - app.run(debug=True, host='0.0.0.0') + api.add_resource(ApiTest, qrz.config['general']['install_path'] + 'index.php/api/auth/' ) + api.add_resource(UploadQso, qrz.config['general']['install_path'] + 'index.php/api/qso') + app.run(debug=True)