From 03cda27d513a943025813dd26d62fef4192e8ef4 Mon Sep 17 00:00:00 2001 From: Sara Yasser Amur Al Shukaili <71524@omantel.om> Date: Mon, 29 Apr 2024 12:09:51 +0400 Subject: [PATCH 1/5] Logic for measurement conversion --- READMe.md | 56 ++++++++++++++++++++++++ controller/__init__.py | 0 controller/app_controllers.py | 78 +++++++++++++++++++++++++++++++++ controller/handlers.py | 69 +++++++++++++++++++++++++++++ error_logs.log | 13 ++++++ main_app.py | 29 ++++++++++++ measurements.db | Bin 0 -> 12288 bytes models/__init__.py | 0 models/conversion.py | 80 ++++++++++++++++++++++++++++++++++ requirements.txt | 3 ++ test_conversion.py | 77 ++++++++++++++++++++++++++++++++ 11 files changed, 405 insertions(+) create mode 100644 READMe.md create mode 100644 controller/__init__.py create mode 100644 controller/app_controllers.py create mode 100644 controller/handlers.py create mode 100644 error_logs.log create mode 100644 main_app.py create mode 100644 measurements.db create mode 100644 models/__init__.py create mode 100644 models/conversion.py create mode 100644 requirements.txt create mode 100644 test_conversion.py diff --git a/READMe.md b/READMe.md new file mode 100644 index 0000000..f5af216 --- /dev/null +++ b/READMe.md @@ -0,0 +1,56 @@ +# Package Measurement Conversion + +## Overview +This Measurement Conversion application enables users to input a string of characters, and receive the output in a JSON format. The inputted string will be transformed into a list of the total values of measured inflows. The application can be accessed through the RESTful API endpoint. The application is constructed with scalability and extensibility in focus, allowing for modifications and expansions. + +## Features +- **Sequence Input Handling:** Accepts a sequence of characters and underscores as input for conversion. +- **Efficient Conversion Algorithms:** Implements efficient algorithms for converting the input sequence into a list of measurements. +- **Clear and adaptable:** Easily modified and extended to include additional functionalities. + +## Installation +- Clone the following url in your command prompt: https://github.com/sarah-alshukaily/PackageMeasurementConversionAPI.git + +### Prerequisites +- Python 3.x +- CherryPy + +### Setup +1. Clone the repository (see the Installation section above). +2. Install required Python packages from requirements.txt: + ```pip install -r requirements.txt``` +## Usage +- Get a specific string: + + Default: http://localhost:8080/?user_input= + Specific port: http://localhost:/?user_input= + +- Get history of all conversions: + + Default: http://localhost:8080/get_history + + Specific port: http://localhost:/get_history + +### Running the Program +- **Script**: + + Default: ```python main.py``` + + Specific port: ```python main_app.py ``` +- **Access URL**: + + Default: http://localhost:8080/ + + Specific port: http://localhost:/ + +## Contributing +Contributions to this project are prohibited due to the course restrictions. + +## License +This project is licensed under the MIT License. + +## Contact +For any queries, please contact sara@gmail.com + +## Acknowledgements +Project by Sara Al Shukaili \ No newline at end of file diff --git a/controller/__init__.py b/controller/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/controller/app_controllers.py b/controller/app_controllers.py new file mode 100644 index 0000000..51f77d2 --- /dev/null +++ b/controller/app_controllers.py @@ -0,0 +1,78 @@ +import sqlite3 +import cherrypy +from models.conversion import Conversion + + +def init_db(): + """ + A function to initialize the SQLite database + :return: The database connection object + """ + conn = sqlite3.connect('measurements.db') + cursor = conn.cursor() + cursor.execute('''CREATE TABLE IF NOT EXISTS conversions + (id INTEGER PRIMARY KEY AUTOINCREMENT, + user_input TEXT, + converted_result TEXT, + status TEXT, + error_message TEXT)''') + conn.commit() + return conn + + +class MeasurementConversion: + exposed = True + + def __init__(self): + self.converter = Conversion() # Instantiate the Conversion class + + @staticmethod + def get_db(): + """ + A function that retrieves the database connection object, and initializing it if it is not present + :return: A database connection object + """ + if not hasattr(cherrypy.thread_data, 'conn'): + cherrypy.thread_data.conn = init_db() + return cherrypy.thread_data.conn + + def convert_input(self, user_input): + """ + A function to convert the user input to the list of values + :param user_input: User input string + :return: Converted result string or list + """ + converted_result = self.converter.converted_string(user_input) # Use the converted_string method + return converted_result + + def save_to_db(self, user_input, converted_result, status): + """ + A function to save conversion data to the database + :param user_input: User input string + :param converted_result: Converted result string or list + :param status: Status of the conversion + """ + with self.get_db() as conn: + cursor = conn.cursor() + if isinstance(converted_result, list): + converted_result = ', '.join(str(item) for item in converted_result) + cursor.execute('''INSERT INTO conversions (user_input, converted_result, status, error_message) + VALUES (?, ?, ?, ?)''', + (user_input, converted_result, status, "")) + conn.commit() + + def retrieve_history(self): + """ + A function to retrieve conversion history from the database + :return: List of conversion history entries + """ + history = [] + try: + with self.get_db() as conn: + cursor = conn.cursor() + cursor.execute('''SELECT * FROM conversions''') + history = cursor.fetchall() + except Exception as e: + return e + # print(f"An error occurred while retrieving history: {e}") # log statement to show the state of program + return history diff --git a/controller/handlers.py b/controller/handlers.py new file mode 100644 index 0000000..6a115ca --- /dev/null +++ b/controller/handlers.py @@ -0,0 +1,69 @@ +import json +import cherrypy +from models.conversion import Conversion +from controller.app_controllers import MeasurementConversion, init_db + + +class MeasurementConversionHandler: + exposed = True + + def __init__(self): + self.controller = MeasurementConversion() + self.conversion = Conversion() + + @staticmethod + def get_db(): + """ + A function that retrieves the database connection object, and initializing it if it is not present + :return: A database connection object + """ + if not hasattr(cherrypy.thread_data, 'conn'): + cherrypy.thread_data.conn = init_db() + return cherrypy.thread_data.conn + + @cherrypy.tools.json_out() + def __call__(self, user_input=None): + """ + A function that exposes an endpoint to convert user's input to a converted list of values as JSON + :param user_input: A sequence of characters that is None by default + :return: A JSON response containing the conversion result, status, and error message + """ + res_msg = {"status": "SUCCESS", "err_msg": "", "result": ""} + try: + if not user_input: + user_input = cherrypy.request.params.get('user_input') + if user_input is not None: + converted_result = self.conversion.converted_string(user_input) + self.controller.save_to_db(user_input, converted_result, "SUCCESS") + res_msg["result"] = converted_result + else: + res_msg["status"] = "FAIL" + res_msg["result"] = "Missing user_input parameter" + except Exception as e: + self.controller.save_to_db(user_input, "", "ERROR") + res_msg["status"] = "ERROR" + res_msg["result"] = str(e) + + return json.dumps(res_msg) + + @cherrypy.expose + @cherrypy.tools.json_out() + def get_history(self): + """ + A function that exposes an endpoint to retrieve conversions history + :return: A JSON response containing conversion history + """ + res_msg = {"status": "SUCCESS", "err_msg": "", "history": []} + try: + with self.get_db() as conn: + cursor = conn.cursor() + # Retrieve conversion history from SQLite + cursor.execute('''SELECT * FROM conversions''') + history = cursor.fetchall() + res_msg["history"] = [ + {"user_input": row[1], "converted_result": row[2], "status": row[3], "error_message": row[4]} for + row in history] + except Exception as e: + res_msg["status"] = "ERROR" + res_msg["err_msg"] = str(e) + return res_msg diff --git a/error_logs.log b/error_logs.log new file mode 100644 index 0000000..58d0286 --- /dev/null +++ b/error_logs.log @@ -0,0 +1,13 @@ +2024-04-29 12:01:43,362:INFO:[29/Apr/2024:12:01:43] ENGINE Bus STARTING +2024-04-29 12:01:43,363:INFO:[29/Apr/2024:12:01:43] ENGINE Started monitor thread 'Autoreloader'. +2024-04-29 12:01:43,581:INFO:[29/Apr/2024:12:01:43] ENGINE Serving on http://0.0.0.0:8080 +2024-04-29 12:01:43,582:INFO:[29/Apr/2024:12:01:43] ENGINE Bus STARTED +2024-04-29 12:01:57,574:INFO:127.0.0.1 - - [29/Apr/2024:12:01:57] "GET /?user_input=abbcc HTTP/1.1" 200 54 "" "PostmanRuntime/7.37.3" +2024-04-29 12:02:04,807:INFO:[29/Apr/2024:12:02:04] ENGINE Keyboard Interrupt: shutting down bus +2024-04-29 12:02:04,807:INFO:[29/Apr/2024:12:02:04] ENGINE Bus STOPPING +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Stopped thread 'Autoreloader'. +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Bus STOPPED +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Bus EXITING +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Bus EXITED +2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Waiting for child threads to terminate... diff --git a/main_app.py b/main_app.py new file mode 100644 index 0000000..1f2a112 --- /dev/null +++ b/main_app.py @@ -0,0 +1,29 @@ +import cherrypy +import sys +import logging + +from controller.handlers import MeasurementConversionHandler + +if __name__ == '__main__': + port = 8080 # Default port + + # Check if a custom port is provided as an argument + if len(sys.argv) > 1: + try: + port = int(sys.argv[1]) + except ValueError: + print("Invalid port number. Using the default port (8080).") + + # Configure LOGGING to file + logging.basicConfig(filename='error_logs.log', level=logging.CRITICAL, + format='%(asctime)s:%(levelname)s:%(message)s') + + # Mount the MeasurementConversionHandler to the CherryPy root + cherrypy.tree.mount(MeasurementConversionHandler(), '/') + cherrypy.config.update({'server.socket_host': '0.0.0.0', 'server.socket_port': port}) + + # Start the CherryPy server + cherrypy.engine.start() + cherrypy.engine.block() + + diff --git a/measurements.db b/measurements.db new file mode 100644 index 0000000000000000000000000000000000000000..72b1d700fafea00861239e92697cfc4c0710376d GIT binary patch literal 12288 zcmeI&O-sWt7zglVFBJsWiRcg!qC2?Z5MMyA&Jkod=iEAQr;>G123x01D|l4Dfj2*c zpTL73M)2-eFs%;e@a5u3{tr!?q)#5o@0QTUai!}^b~^C-!e?6~O(-S1j1fW%-Qv0p zgX&IVIMB~<{971g&3&BGS+Ud|NxkSB0s;_#00bZa0SG_<0uX=z1RxLz)M7?vb(OY! z(e6og(bL;gTgi(+y3Y78UaIq=#hF#yt8g}!n{!297WB&e%{-mRWV7`4Dyr!W+)L@H z?!Z+e-PosEBQGY|myzpsSh;HPeO_m^dik(eZ?Oa3V#TI)RIch`hrDVPzF8b7>DgWP zJn)&tPrgli{|aArY)`77_j9uHg&(LN>q*ZWcy?bZCC+4&nGg5oN%NYR&*qc)VBYI4 z0s;_#00bZa0SG_<0uX=z1Rwx`zZRHF8YDBjFeTb;$Js2f?MAay;*CZ+VUTH4&x?)W zOniK1IcAXTQn=RXyf<4{*om(7k5!A*ATujr9Z_~KMNc1FL f1Rwwb2tWV=5P$##AOHaf{0{+># 0 and input_string[len(input_string)-1] == 26 : + return "Invalid" + else: + for digit in input_string: + if digit == 26: + merged_value += 26 + else: + merged_list.append(digit + merged_value) + merged_value = 0 + # print(f"The merged list is: {merged_list}") # log statement to show the state of program + return merged_list + + def converted_string(self, input_string): + """ + A function which converts the input string to a list of the total values + :param input_string: A sequence of characters + :return: A result list containing the converted values + """ + char_list = [self.char_value(input_string[i]) for i in range(len(input_string))] + result_list = [] + merged_list = self.get_merged_list(char_list) + if merged_list == 'Invalid': + return "Invalid input" + else: + while merged_list: + counter = merged_list[0] + if counter == 0: + result_list.append(0) + merged_list = [] + elif counter >= len(merged_list) or len(merged_list) < 1: + return "Invalid input" + else: + merged_list.pop(0) + result_list.append(sum(merged_list[0:counter])) + merged_list = merged_list[counter:] + + if result_list and len(merged_list) == 0: + return result_list + else: + return f"Invalid input" + +# # Check that the conversion is correct +# user_string = Conversion() +# print(user_string.converted_string("abbcc")) + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f5e68b9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +CherryPy==18.9.0 +requests==2.31.0 +setuptools==69.2.0 diff --git a/test_conversion.py b/test_conversion.py new file mode 100644 index 0000000..c1b5707 --- /dev/null +++ b/test_conversion.py @@ -0,0 +1,77 @@ +import unittest + +from models.conversion import Conversion + + +class TestConversion(unittest.TestCase): + """ + A group of unit tests for the 'converted_string' function from the Conversion class + """ + + def test_string_with_double_letters(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('aa'), [1]) + + def test_string_multiple_letters(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('abbcc'), [2, 6]) + + def test_string_with_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('dz_a_aazzaaa'), [28, 53, 1]) + + def test_string_with_one_letter_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('a_'), [0]) + + def test_valid_string1(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('abcdabcdab'), [2, 7, 7]) + + def test_string_ending_with_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('abcdabcdab_'), [2, 7, 7, 0]) + + def test_string_starting_with_z(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('zdaaaaaaaabaaaaaaaabaaaaaaaabbaa'), [34]) + + def test_string_starting_with_double_z(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_'), [26]) + + def test_string_starting_with_z_a(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa'), [40, 1]) + + def test_string_only_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('_'), [0]) + + def test_string_starting_with_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('_ad'), [0]) + + def test_string_starting_all_underscore(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('____'), [0]) + + def test_invalid_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('aaa'), "Invalid input") + + def test_empty_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string(''), "Invalid input") + + def test_single_letter_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('a'), "Invalid input") + + def test_invalid_length_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('abccc'), "Invalid input") + + +if __name__ == "__main__": + unittest.main(verbosity=2) From 8338302720a8f3e957b91842ca5dfe89dd4964c0 Mon Sep 17 00:00:00 2001 From: Sara Yasser Amur Al Shukaili <71524@omantel.om> Date: Wed, 1 May 2024 10:42:39 +0400 Subject: [PATCH 2/5] Edited logic for measurement conversion --- controller/conversion_controller.py | 182 ++++ controller/handlers.py | 69 -- error_logs.log | 920 ++++++++++++++++++ main_app.py | 4 +- measurements.db | Bin 12288 -> 12288 bytes models/database_initializer.py | 18 + models/sequence_output.py | 7 + services/__init__.py | 0 .../conversion_service.py | 0 test_conversion.py | 2 +- utilis/__init__.py | 0 utilis/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 162 bytes .../database_operations.cpython-312.pyc | Bin 0 -> 3193 bytes .../database_operations.py | 43 +- 14 files changed, 1136 insertions(+), 109 deletions(-) create mode 100644 controller/conversion_controller.py delete mode 100644 controller/handlers.py create mode 100644 models/database_initializer.py create mode 100644 models/sequence_output.py create mode 100644 services/__init__.py rename models/conversion.py => services/conversion_service.py (100%) create mode 100644 utilis/__init__.py create mode 100644 utilis/__pycache__/__init__.cpython-312.pyc create mode 100644 utilis/__pycache__/database_operations.cpython-312.pyc rename controller/app_controllers.py => utilis/database_operations.py (53%) diff --git a/controller/conversion_controller.py b/controller/conversion_controller.py new file mode 100644 index 0000000..d0add8e --- /dev/null +++ b/controller/conversion_controller.py @@ -0,0 +1,182 @@ +# import json +# import cherrypy +# from services.conversion_service import Conversion +# # from controller.app_controllers import MeasurementConversion +# from models.database_initializer import init_db +# from utilis.database_operations import ConversionDatabaseOperations +# +# +# class ConversionController: +# exposed = True +# +# class MeasurementConversion: +# +# def __init__(self): +# self.converter = Conversion() # Instantiate the Conversion class +# +# def convert_input(self, user_input): +# """ +# A function to convert the user input to the list of values +# :param user_input: User input string +# :return: Converted result string or list +# """ +# converted_result = self.converter.converted_string(user_input) # Use the converted_string method +# return converted_result +# +# def __init__(self): +# self.controller = ConversionController.MeasurementConversion() +# self.conversion = Conversion() +# self.dbops = ConversionDatabaseOperations() +# +# @staticmethod +# def get_db(): +# """ +# A function that retrieves the database connection object, and initializing it if it is not present +# :return: A database connection object +# """ +# if not hasattr(cherrypy.thread_data, 'conn'): +# cherrypy.thread_data.conn = init_db() +# return cherrypy.thread_data.conn +# +# @cherrypy.tools.json_out() +# def __call__(self, user_input=None): +# """ +# A function that exposes an endpoint to convert user's input to a converted list of values as JSON +# :param user_input: A sequence of characters that is None by default +# :return: A JSON response containing the conversion result, status, and error message +# """ +# res_msg = {"status": "SUCCESS", "err_msg": "", "result": ""} +# try: +# if not user_input: +# user_input = cherrypy.request.params.get('user_input') +# if user_input is not None: +# converted_result = self.conversion.converted_string(user_input) +# self.dbops.save_to_db(user_input, converted_result, "SUCCESS") +# res_msg["result"] = converted_result +# else: +# res_msg["status"] = "FAIL" +# res_msg["result"] = "Missing user_input parameter" +# except Exception as e: +# self.dbops.save_to_db(user_input, "", "ERROR") +# res_msg["status"] = "ERROR" +# res_msg["result"] = str(e) +# +# return json.dumps(res_msg) +# +# @cherrypy.expose +# @cherrypy.tools.json_out() +# def get_history(self): +# """ +# A function that exposes an endpoint to retrieve conversions history +# :return: A JSON response containing conversion history +# """ +# res_msg = {"status": "SUCCESS", "err_msg": "", "history": []} +# try: +# with self.get_db() as conn: +# cursor = conn.cursor() +# # Retrieve conversion history from SQLite +# cursor.execute('''SELECT * FROM conversions''') +# history = cursor.fetchall() +# res_msg["history"] = [ +# {"user_input": row[1], "converted_result": row[2], "status": row[3], "error_message": row[4]} for +# row in history] +# except Exception as e: +# res_msg["status"] = "ERROR" +# res_msg["err_msg"] = str(e) +# return res_msg + +import json +import cherrypy +from services.conversion_service import Conversion +from models.database_initializer import init_db +from utilis.database_operations import ConversionDatabaseOperations +from models.sequence_output import SequenceOutput + + +class ConversionController: + exposed = True + + class MeasurementConversion: + + def __init__(self): + self.converter = Conversion() # Instantiate the Conversion class + + def convert_input(self, user_input): + """ + A function to convert the user input to the list of values + :param user_input: User input string + :return: Converted result string or list + """ + converted_result = self.converter.converted_string(user_input) # Use the converted_string method + return converted_result + + def __init__(self): + self.controller = ConversionController.MeasurementConversion() + self.conversion = Conversion() + self.dbops = ConversionDatabaseOperations() + + @staticmethod + def get_db(): + """ + A function that retrieves the database connection object, and initializing it if it is not present + :return: A database connection object + """ + if not hasattr(cherrypy.thread_data, 'conn'): + cherrypy.thread_data.conn = init_db() + return cherrypy.thread_data.conn + + @cherrypy.tools.json_out() + def __call__(self, user_input=None): + """ + A function that exposes an endpoint to convert user's input to a converted list of values as JSON + :param user_input: A sequence of characters that is None by default + :return: A JSON response containing the conversion result, status, and error message + """ + res_msg = {"status": "SUCCESS", "err_msg": "", "result": ""} + m = SequenceOutput(user_input, None, None, None) + try: + if not user_input: + user_input = cherrypy.request.params.get('user_input') + if user_input is not None: + converted_result = self.conversion.converted_string(user_input) + m.user_input = user_input + m.converted_result = str(converted_result) + m.status = "SUCCESS" + m.error_message = "" + self.dbops.save_to_db(m, converted_result) + res_msg["result"] = converted_result + else: + res_msg["status"] = "FAIL" + res_msg["result"] = "Missing user_input parameter" + except Exception as e: + m.user_input = user_input + m.converted_result = "" + m.status = "ERROR" + m.error_message = "ERROR" + self.dbops.save_to_db(m, converted_result="") + res_msg["status"] = "ERROR" + res_msg["result"] = str(e) + + return json.dumps(res_msg) + + @cherrypy.expose + @cherrypy.tools.json_out() + def get_history(self): + """ + A function that exposes an endpoint to retrieve conversions history + :return: A JSON response containing conversion history + """ + res_msg = {"status": "SUCCESS", "err_msg": "", "history": []} + try: + with self.get_db() as conn: + cursor = conn.cursor() + # Retrieve conversion history from SQLite + cursor.execute('''SELECT * FROM conversions''') + history = cursor.fetchall() + res_msg["history"] = [ + {"user_input": row[1], "converted_result": row[2], "status": row[3], "error_message": row[4]} for + row in history] + except Exception as e: + res_msg["status"] = "ERROR" + res_msg["err_msg"] = str(e) + return res_msg diff --git a/controller/handlers.py b/controller/handlers.py deleted file mode 100644 index 6a115ca..0000000 --- a/controller/handlers.py +++ /dev/null @@ -1,69 +0,0 @@ -import json -import cherrypy -from models.conversion import Conversion -from controller.app_controllers import MeasurementConversion, init_db - - -class MeasurementConversionHandler: - exposed = True - - def __init__(self): - self.controller = MeasurementConversion() - self.conversion = Conversion() - - @staticmethod - def get_db(): - """ - A function that retrieves the database connection object, and initializing it if it is not present - :return: A database connection object - """ - if not hasattr(cherrypy.thread_data, 'conn'): - cherrypy.thread_data.conn = init_db() - return cherrypy.thread_data.conn - - @cherrypy.tools.json_out() - def __call__(self, user_input=None): - """ - A function that exposes an endpoint to convert user's input to a converted list of values as JSON - :param user_input: A sequence of characters that is None by default - :return: A JSON response containing the conversion result, status, and error message - """ - res_msg = {"status": "SUCCESS", "err_msg": "", "result": ""} - try: - if not user_input: - user_input = cherrypy.request.params.get('user_input') - if user_input is not None: - converted_result = self.conversion.converted_string(user_input) - self.controller.save_to_db(user_input, converted_result, "SUCCESS") - res_msg["result"] = converted_result - else: - res_msg["status"] = "FAIL" - res_msg["result"] = "Missing user_input parameter" - except Exception as e: - self.controller.save_to_db(user_input, "", "ERROR") - res_msg["status"] = "ERROR" - res_msg["result"] = str(e) - - return json.dumps(res_msg) - - @cherrypy.expose - @cherrypy.tools.json_out() - def get_history(self): - """ - A function that exposes an endpoint to retrieve conversions history - :return: A JSON response containing conversion history - """ - res_msg = {"status": "SUCCESS", "err_msg": "", "history": []} - try: - with self.get_db() as conn: - cursor = conn.cursor() - # Retrieve conversion history from SQLite - cursor.execute('''SELECT * FROM conversions''') - history = cursor.fetchall() - res_msg["history"] = [ - {"user_input": row[1], "converted_result": row[2], "status": row[3], "error_message": row[4]} for - row in history] - except Exception as e: - res_msg["status"] = "ERROR" - res_msg["err_msg"] = str(e) - return res_msg diff --git a/error_logs.log b/error_logs.log index 58d0286..184b7f6 100644 --- a/error_logs.log +++ b/error_logs.log @@ -11,3 +11,923 @@ 2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Bus EXITING 2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Bus EXITED 2024-04-29 12:02:05,006:INFO:[29/Apr/2024:12:02:05] ENGINE Waiting for child threads to terminate... +2024-05-01 08:54:23,434:INFO:[01/May/2024:08:54:23] ENGINE Bus STARTING +2024-05-01 08:54:23,435:INFO:[01/May/2024:08:54:23] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:54:23,656:INFO:[01/May/2024:08:54:23] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:54:23,656:INFO:[01/May/2024:08:54:23] ENGINE Bus STARTED +2024-05-01 08:54:59,871:INFO:127.0.0.1 - - [01/May/2024:08:54:59] "GET /?user_input=abbcc HTTP/1.1" 404 1518 "" "PostmanRuntime/7.37.3" +2024-05-01 08:55:04,235:INFO:127.0.0.1 - - [01/May/2024:08:55:04] "GET /?user_input=abbcc HTTP/1.1" 404 1518 "" "PostmanRuntime/7.37.3" +2024-05-01 08:55:21,209:INFO:[01/May/2024:08:55:21] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\handlers.py changed. +2024-05-01 08:55:21,209:INFO:[01/May/2024:08:55:21] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:55:21,209:INFO:[01/May/2024:08:55:21] ENGINE Bus STOPPING +2024-05-01 08:55:21,347:INFO:[01/May/2024:08:55:21] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 08:55:21,347:INFO:[01/May/2024:08:55:21] ENGINE Bus STOPPED +2024-05-01 08:55:21,347:INFO:[01/May/2024:08:55:21] ENGINE Bus EXITING +2024-05-01 08:55:21,347:INFO:[01/May/2024:08:55:21] ENGINE Bus EXITED +2024-05-01 08:55:21,410:INFO:[01/May/2024:08:55:21] ENGINE Waiting for child threads to terminate... +2024-05-01 08:55:21,410:INFO:[01/May/2024:08:55:21] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 08:55:22,408:INFO:[01/May/2024:08:55:22] ENGINE Bus STARTING +2024-05-01 08:55:22,409:INFO:[01/May/2024:08:55:22] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:55:22,625:INFO:[01/May/2024:08:55:22] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:55:22,626:INFO:[01/May/2024:08:55:22] ENGINE Bus STARTED +2024-05-01 08:55:31,238:INFO:[01/May/2024:08:55:31] ENGINE Bus STARTING +2024-05-01 08:55:31,240:INFO:[01/May/2024:08:55:31] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:55:32,437:ERROR:[01/May/2024:08:55:32] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-01 08:55:32,437:ERROR:[01/May/2024:08:55:32] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-01 08:55:32,437:INFO:[01/May/2024:08:55:32] ENGINE Bus STOPPING +2024-05-01 08:55:32,438:INFO:[01/May/2024:08:55:32] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-01 08:55:32,438:INFO:[01/May/2024:08:55:32] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:55:32,438:INFO:[01/May/2024:08:55:32] ENGINE Bus STOPPED +2024-05-01 08:55:32,438:INFO:[01/May/2024:08:55:32] ENGINE Bus EXITING +2024-05-01 08:55:32,438:INFO:[01/May/2024:08:55:32] ENGINE Bus EXITED +2024-05-01 08:56:21,813:INFO:[01/May/2024:08:56:21] ENGINE Bus STARTING +2024-05-01 08:56:21,813:INFO:[01/May/2024:08:56:21] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:56:22,028:INFO:[01/May/2024:08:56:22] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:56:22,028:INFO:[01/May/2024:08:56:22] ENGINE Bus STARTED +2024-05-01 08:56:24,776:INFO:127.0.0.1 - - [01/May/2024:08:56:24] "GET /?user_input=abbcc HTTP/1.1" 200 54 "" "PostmanRuntime/7.37.3" +2024-05-01 08:56:32,698:INFO:[01/May/2024:08:56:32] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 08:56:32,698:INFO:[01/May/2024:08:56:32] ENGINE Bus STOPPING +2024-05-01 08:56:32,840:INFO:[01/May/2024:08:56:32] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 08:56:32,840:INFO:[01/May/2024:08:56:32] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:56:32,841:INFO:[01/May/2024:08:56:32] ENGINE Bus STOPPED +2024-05-01 08:56:32,841:INFO:[01/May/2024:08:56:32] ENGINE Bus EXITING +2024-05-01 08:56:32,841:INFO:[01/May/2024:08:56:32] ENGINE Bus EXITED +2024-05-01 08:56:32,841:INFO:[01/May/2024:08:56:32] ENGINE Waiting for child threads to terminate... +2024-05-01 08:56:33,594:INFO:[01/May/2024:08:56:33] ENGINE Bus STARTING +2024-05-01 08:56:33,595:INFO:[01/May/2024:08:56:33] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:56:33,806:INFO:[01/May/2024:08:56:33] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:56:33,806:INFO:[01/May/2024:08:56:33] ENGINE Bus STARTED +2024-05-01 08:56:41,057:INFO:127.0.0.1 - - [01/May/2024:08:56:41] "GET /?user_input=abbcc_ HTTP/1.1" 404 1518 "" "PostmanRuntime/7.37.3" +2024-05-01 08:56:45,854:INFO:[01/May/2024:08:56:45] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\handlers.py changed. +2024-05-01 08:56:45,854:INFO:[01/May/2024:08:56:45] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:56:45,854:INFO:[01/May/2024:08:56:45] ENGINE Bus STOPPING +2024-05-01 08:56:46,072:INFO:[01/May/2024:08:56:46] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 08:56:46,072:INFO:[01/May/2024:08:56:46] ENGINE Bus STOPPED +2024-05-01 08:56:46,072:INFO:[01/May/2024:08:56:46] ENGINE Bus EXITING +2024-05-01 08:56:46,072:INFO:[01/May/2024:08:56:46] ENGINE Bus EXITED +2024-05-01 08:56:46,104:INFO:[01/May/2024:08:56:46] ENGINE Waiting for child threads to terminate... +2024-05-01 08:56:46,105:INFO:[01/May/2024:08:56:46] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 08:56:47,143:INFO:[01/May/2024:08:56:47] ENGINE Bus STARTING +2024-05-01 08:56:47,143:INFO:[01/May/2024:08:56:47] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:56:47,381:INFO:[01/May/2024:08:56:47] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:56:47,381:INFO:[01/May/2024:08:56:47] ENGINE Bus STARTED +2024-05-01 08:57:11,519:INFO:[01/May/2024:08:57:11] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\handlers.py changed. +2024-05-01 08:57:11,519:INFO:[01/May/2024:08:57:11] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:57:11,519:INFO:[01/May/2024:08:57:11] ENGINE Bus STOPPING +2024-05-01 08:57:11,700:INFO:[01/May/2024:08:57:11] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 08:57:11,700:INFO:[01/May/2024:08:57:11] ENGINE Bus STOPPED +2024-05-01 08:57:11,700:INFO:[01/May/2024:08:57:11] ENGINE Bus EXITING +2024-05-01 08:57:11,700:INFO:[01/May/2024:08:57:11] ENGINE Bus EXITED +2024-05-01 08:57:11,795:INFO:[01/May/2024:08:57:11] ENGINE Waiting for child threads to terminate... +2024-05-01 08:57:11,795:INFO:[01/May/2024:08:57:11] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 08:57:37,361:INFO:[01/May/2024:08:57:37] ENGINE Bus STARTING +2024-05-01 08:57:37,362:INFO:[01/May/2024:08:57:37] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:57:37,573:INFO:[01/May/2024:08:57:37] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:57:37,574:INFO:[01/May/2024:08:57:37] ENGINE Bus STARTED +2024-05-01 08:57:40,024:INFO:127.0.0.1 - - [01/May/2024:08:57:40] "GET /?user_input=abbcc_ HTTP/1.1" 200 57 "" "PostmanRuntime/7.37.3" +2024-05-01 08:58:19,999:INFO:[01/May/2024:08:58:19] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\models\conversion.py changed. +2024-05-01 08:58:19,999:INFO:[01/May/2024:08:58:19] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 08:58:19,999:INFO:[01/May/2024:08:58:19] ENGINE Bus STOPPING +2024-05-01 08:58:20,128:INFO:[01/May/2024:08:58:20] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 08:58:20,128:INFO:[01/May/2024:08:58:20] ENGINE Bus STOPPED +2024-05-01 08:58:20,128:INFO:[01/May/2024:08:58:20] ENGINE Bus EXITING +2024-05-01 08:58:20,128:INFO:[01/May/2024:08:58:20] ENGINE Bus EXITED +2024-05-01 08:58:20,153:INFO:[01/May/2024:08:58:20] ENGINE Waiting for child threads to terminate... +2024-05-01 08:58:20,154:INFO:[01/May/2024:08:58:20] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 08:58:59,243:INFO:[01/May/2024:08:58:59] ENGINE Bus STARTING +2024-05-01 08:58:59,244:INFO:[01/May/2024:08:58:59] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 08:58:59,466:INFO:[01/May/2024:08:58:59] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 08:58:59,466:INFO:[01/May/2024:08:58:59] ENGINE Bus STARTED +2024-05-01 08:59:02,001:INFO:127.0.0.1 - - [01/May/2024:08:59:02] "GET /?user_input=abbcc_ HTTP/1.1" 200 57 "" "PostmanRuntime/7.37.3" +2024-05-01 09:00:13,310:INFO:[01/May/2024:09:00:13] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:00:13,310:INFO:[01/May/2024:09:00:13] ENGINE Bus STOPPING +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE Bus STOPPED +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE Bus EXITING +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE Bus EXITED +2024-05-01 09:00:13,452:INFO:[01/May/2024:09:00:13] ENGINE Waiting for child threads to terminate... +2024-05-01 09:00:14,542:INFO:[01/May/2024:09:00:14] ENGINE Bus STARTING +2024-05-01 09:00:14,543:INFO:[01/May/2024:09:00:14] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:00:14,759:INFO:[01/May/2024:09:00:14] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:00:14,759:INFO:[01/May/2024:09:00:14] ENGINE Bus STARTED +2024-05-01 09:00:17,761:INFO:127.0.0.1 - - [01/May/2024:09:00:17] "GET /?user_input=abbcc_ HTTP/1.1" 200 57 "" "PostmanRuntime/7.37.3" +2024-05-01 09:00:32,682:INFO:127.0.0.1 - - [01/May/2024:09:00:32] "GET /get_history HTTP/1.1" 200 923 "" "PostmanRuntime/7.37.3" +2024-05-01 09:00:39,468:INFO:[01/May/2024:09:00:39] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:00:39,469:INFO:[01/May/2024:09:00:39] ENGINE Bus STOPPING +2024-05-01 09:00:39,622:INFO:[01/May/2024:09:00:39] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:00:39,623:INFO:[01/May/2024:09:00:39] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:00:39,623:INFO:[01/May/2024:09:00:39] ENGINE Bus STOPPED +2024-05-01 09:00:39,623:INFO:[01/May/2024:09:00:39] ENGINE Bus EXITING +2024-05-01 09:00:39,623:INFO:[01/May/2024:09:00:39] ENGINE Bus EXITED +2024-05-01 09:00:39,623:INFO:[01/May/2024:09:00:39] ENGINE Waiting for child threads to terminate... +2024-05-01 09:19:21,825:INFO:[01/May/2024:09:19:21] ENGINE Bus STARTING +2024-05-01 09:19:21,826:INFO:[01/May/2024:09:19:21] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:19:22,056:INFO:[01/May/2024:09:19:22] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:19:22,056:INFO:[01/May/2024:09:19:22] ENGINE Bus STARTED +2024-05-01 09:19:26,920:INFO:127.0.0.1 - - [01/May/2024:09:19:26] "GET /get_history HTTP/1.1" 200 923 "" "PostmanRuntime/7.37.3" +2024-05-01 09:19:33,821:ERROR:[01/May/2024:09:19:33] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 37, in __call__ + self.controller.save_to_db(user_input, converted_result, "SUCCESS") + ^^^^^^^^^^^^^^^^^^^^^^^^^^ +AttributeError: 'MeasurementConversion' object has no attribute 'save_to_db' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 43, in __call__ + self.controller.save_to_db(user_input, "", "ERROR") + ^^^^^^^^^^^^^^^^^^^^^^^^^^ +AttributeError: 'MeasurementConversion' object has no attribute 'save_to_db' +2024-05-01 09:19:33,896:INFO:[01/May/2024:09:19:33] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 18cb79e7-be14-401e-969e-4ec31cb75bf7 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 09:19:33,901:INFO:127.0.0.1 - - [01/May/2024:09:19:33] "GET /?user_input=aa HTTP/1.1" 500 2312 "" "PostmanRuntime/7.37.3" +2024-05-01 09:21:28,595:INFO:[01/May/2024:09:21:28] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:21:28,595:INFO:[01/May/2024:09:21:28] ENGINE Bus STOPPING +2024-05-01 09:21:28,791:INFO:[01/May/2024:09:21:28] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:21:28,791:INFO:[01/May/2024:09:21:28] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:21:28,791:INFO:[01/May/2024:09:21:28] ENGINE Bus STOPPED +2024-05-01 09:21:28,792:INFO:[01/May/2024:09:21:28] ENGINE Bus EXITING +2024-05-01 09:21:28,792:INFO:[01/May/2024:09:21:28] ENGINE Bus EXITED +2024-05-01 09:21:28,792:INFO:[01/May/2024:09:21:28] ENGINE Waiting for child threads to terminate... +2024-05-01 09:22:57,764:INFO:[01/May/2024:09:22:57] ENGINE Bus STARTING +2024-05-01 09:22:57,765:INFO:[01/May/2024:09:22:57] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:22:57,997:INFO:[01/May/2024:09:22:57] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:22:57,997:INFO:[01/May/2024:09:22:57] ENGINE Bus STARTED +2024-05-01 09:23:01,037:INFO:127.0.0.1 - - [01/May/2024:09:23:01] "GET /?user_input=aa HTTP/1.1" 200 51 "" "PostmanRuntime/7.37.3" +2024-05-01 09:23:33,195:INFO:127.0.0.1 - - [01/May/2024:09:23:33] "GET /?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "PostmanRuntime/7.37.3" +2024-05-01 09:23:40,942:INFO:127.0.0.1 - - [01/May/2024:09:23:40] "GET /get_history HTTP/1.1" 200 1119 "" "PostmanRuntime/7.37.3" +2024-05-01 09:23:52,172:INFO:[01/May/2024:09:23:52] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:23:52,173:INFO:[01/May/2024:09:23:52] ENGINE Bus STOPPING +2024-05-01 09:23:52,356:INFO:[01/May/2024:09:23:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:23:52,356:INFO:[01/May/2024:09:23:52] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:23:52,358:INFO:[01/May/2024:09:23:52] ENGINE Bus STOPPED +2024-05-01 09:23:52,358:INFO:[01/May/2024:09:23:52] ENGINE Bus EXITING +2024-05-01 09:23:52,358:INFO:[01/May/2024:09:23:52] ENGINE Bus EXITED +2024-05-01 09:23:52,358:INFO:[01/May/2024:09:23:52] ENGINE Waiting for child threads to terminate... +2024-05-01 09:25:02,630:INFO:[01/May/2024:09:25:02] ENGINE Bus STARTING +2024-05-01 09:25:02,631:INFO:[01/May/2024:09:25:02] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:25:02,850:INFO:[01/May/2024:09:25:02] ENGINE Serving on http://0.0.0.0:8888 +2024-05-01 09:25:02,850:INFO:[01/May/2024:09:25:02] ENGINE Bus STARTED +2024-05-01 09:25:13,842:INFO:127.0.0.1 - - [01/May/2024:09:25:13] "GET /get_history HTTP/1.1" 200 1119 "" "PostmanRuntime/7.37.3" +2024-05-01 09:25:23,065:INFO:127.0.0.1 - - [01/May/2024:09:25:23] "GET /aa HTTP/1.1" 200 51 "" "PostmanRuntime/7.37.3" +2024-05-01 09:25:27,375:INFO:[01/May/2024:09:25:27] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:25:27,380:INFO:[01/May/2024:09:25:27] ENGINE Bus STOPPING +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8888)) shut down +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE Bus STOPPED +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE Bus EXITING +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE Bus EXITED +2024-05-01 09:25:27,573:INFO:[01/May/2024:09:25:27] ENGINE Waiting for child threads to terminate... +2024-05-01 09:42:34,438:INFO:[01/May/2024:09:42:34] ENGINE Bus STARTING +2024-05-01 09:42:34,439:INFO:[01/May/2024:09:42:34] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:42:34,648:INFO:[01/May/2024:09:42:34] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:42:34,648:INFO:[01/May/2024:09:42:34] ENGINE Bus STARTED +2024-05-01 09:43:26,232:INFO:[01/May/2024:09:43:26] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:43:26,232:INFO:[01/May/2024:09:43:26] ENGINE Bus STOPPING +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE Bus STOPPED +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE Bus EXITING +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE Bus EXITED +2024-05-01 09:43:26,395:INFO:[01/May/2024:09:43:26] ENGINE Waiting for child threads to terminate... +2024-05-01 09:43:26,954:INFO:[01/May/2024:09:43:26] ENGINE Bus STARTING +2024-05-01 09:43:26,955:INFO:[01/May/2024:09:43:26] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:43:27,162:INFO:[01/May/2024:09:43:27] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:43:27,162:INFO:[01/May/2024:09:43:27] ENGINE Bus STARTED +2024-05-01 09:43:35,318:INFO:127.0.0.1 - - [01/May/2024:09:43:35] "GET /abc HTTP/1.1" 200 63 "" "PostmanRuntime/7.37.3" +2024-05-01 09:43:43,093:INFO:127.0.0.1 - - [01/May/2024:09:43:43] "GET /get_history HTTP/1.1" 200 1310 "" "PostmanRuntime/7.37.3" +2024-05-01 09:43:48,201:INFO:[01/May/2024:09:43:48] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:43:48,201:INFO:[01/May/2024:09:43:48] ENGINE Bus STOPPING +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE Bus STOPPED +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE Bus EXITING +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE Bus EXITED +2024-05-01 09:43:48,352:INFO:[01/May/2024:09:43:48] ENGINE Waiting for child threads to terminate... +2024-05-01 09:44:09,066:INFO:[01/May/2024:09:44:09] ENGINE Bus STARTING +2024-05-01 09:44:09,067:INFO:[01/May/2024:09:44:09] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:44:09,304:INFO:[01/May/2024:09:44:09] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:44:09,304:INFO:[01/May/2024:09:44:09] ENGINE Bus STARTED +2024-05-01 09:44:11,730:INFO:127.0.0.1 - - [01/May/2024:09:44:11] "GET /get_history HTTP/1.1" 200 1310 "" "PostmanRuntime/7.37.3" +2024-05-01 09:44:19,479:INFO:127.0.0.1 - - [01/May/2024:09:44:19] "GET /abbccc HTTP/1.1" 200 63 "" "PostmanRuntime/7.37.3" +2024-05-01 09:44:25,939:INFO:127.0.0.1 - - [01/May/2024:09:44:25] "GET /abbcc HTTP/1.1" 200 54 "" "PostmanRuntime/7.37.3" +2024-05-01 09:44:39,126:INFO:[01/May/2024:09:44:39] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:44:39,126:INFO:[01/May/2024:09:44:39] ENGINE Bus STOPPING +2024-05-01 09:44:39,289:INFO:[01/May/2024:09:44:39] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:44:39,289:INFO:[01/May/2024:09:44:39] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:44:39,290:INFO:[01/May/2024:09:44:39] ENGINE Bus STOPPED +2024-05-01 09:44:39,290:INFO:[01/May/2024:09:44:39] ENGINE Bus EXITING +2024-05-01 09:44:39,290:INFO:[01/May/2024:09:44:39] ENGINE Bus EXITED +2024-05-01 09:44:39,290:INFO:[01/May/2024:09:44:39] ENGINE Waiting for child threads to terminate... +2024-05-01 09:46:45,353:INFO:[01/May/2024:09:46:45] ENGINE Bus STARTING +2024-05-01 09:46:45,354:INFO:[01/May/2024:09:46:45] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 09:46:45,591:INFO:[01/May/2024:09:46:45] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 09:46:45,592:INFO:[01/May/2024:09:46:45] ENGINE Bus STARTED +2024-05-01 09:46:53,207:INFO:127.0.0.1 - - [01/May/2024:09:46:53] "GET /get_history HTTP/1.1" 200 1510 "" "PostmanRuntime/7.37.3" +2024-05-01 09:47:05,356:INFO:[01/May/2024:09:47:05] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 09:47:05,357:INFO:[01/May/2024:09:47:05] ENGINE Bus STOPPING +2024-05-01 09:47:05,535:INFO:[01/May/2024:09:47:05] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 09:47:05,535:INFO:[01/May/2024:09:47:05] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 09:47:05,536:INFO:[01/May/2024:09:47:05] ENGINE Bus STOPPED +2024-05-01 09:47:05,536:INFO:[01/May/2024:09:47:05] ENGINE Bus EXITING +2024-05-01 09:47:05,536:INFO:[01/May/2024:09:47:05] ENGINE Bus EXITED +2024-05-01 09:47:05,536:INFO:[01/May/2024:09:47:05] ENGINE Waiting for child threads to terminate... +2024-05-01 10:02:48,605:INFO:[01/May/2024:10:02:48] ENGINE Bus STARTING +2024-05-01 10:02:48,606:INFO:[01/May/2024:10:02:48] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:02:48,829:INFO:[01/May/2024:10:02:48] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:02:48,829:INFO:[01/May/2024:10:02:48] ENGINE Bus STARTED +2024-05-01 10:02:52,932:INFO:127.0.0.1 - - [01/May/2024:10:02:52] "GET /get_history HTTP/1.1" 200 1510 "" "PostmanRuntime/7.37.3" +2024-05-01 10:03:04,651:ERROR:[01/May/2024:10:03:04] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 53, in __call__ + self.dbops.save_to_db(user_input, converted_result, "SUCCESS") +TypeError: ConversionDatabaseOperations.save_to_db() takes 3 positional arguments but 4 were given + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 59, in __call__ + self.dbops.save_to_db(user_input, "", "ERROR") +TypeError: ConversionDatabaseOperations.save_to_db() takes 3 positional arguments but 4 were given +2024-05-01 10:03:04,742:INFO:[01/May/2024:10:03:04] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 8c46498d-635d-4cc2-9061-d936726c3f99 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:03:04,744:INFO:127.0.0.1 - - [01/May/2024:10:03:04] "GET /bcc HTTP/1.1" 500 2284 "" "PostmanRuntime/7.37.3" +2024-05-01 10:10:39,284:INFO:[01/May/2024:10:10:39] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-01 10:10:39,284:INFO:[01/May/2024:10:10:39] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:10:39,285:INFO:[01/May/2024:10:10:39] ENGINE Bus STOPPING +2024-05-01 10:10:39,414:INFO:[01/May/2024:10:10:39] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:10:39,414:INFO:[01/May/2024:10:10:39] ENGINE Bus STOPPED +2024-05-01 10:10:39,414:INFO:[01/May/2024:10:10:39] ENGINE Bus EXITING +2024-05-01 10:10:39,414:INFO:[01/May/2024:10:10:39] ENGINE Bus EXITED +2024-05-01 10:10:39,445:INFO:[01/May/2024:10:10:39] ENGINE Waiting for child threads to terminate... +2024-05-01 10:10:39,446:INFO:[01/May/2024:10:10:39] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 10:10:39,957:INFO:[01/May/2024:10:10:39] ENGINE Bus STARTING +2024-05-01 10:10:39,958:INFO:[01/May/2024:10:10:39] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:10:40,170:INFO:[01/May/2024:10:10:40] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:10:40,170:INFO:[01/May/2024:10:10:40] ENGINE Bus STARTED +2024-05-01 10:12:39,873:INFO:[01/May/2024:10:12:39] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-01 10:12:39,873:INFO:[01/May/2024:10:12:39] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:12:39,873:INFO:[01/May/2024:10:12:39] ENGINE Bus STOPPING +2024-05-01 10:12:40,059:INFO:[01/May/2024:10:12:40] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:12:40,059:INFO:[01/May/2024:10:12:40] ENGINE Bus STOPPED +2024-05-01 10:12:40,059:INFO:[01/May/2024:10:12:40] ENGINE Bus EXITING +2024-05-01 10:12:40,059:INFO:[01/May/2024:10:12:40] ENGINE Bus EXITED +2024-05-01 10:12:40,154:INFO:[01/May/2024:10:12:40] ENGINE Waiting for child threads to terminate... +2024-05-01 10:12:40,154:INFO:[01/May/2024:10:12:40] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 10:12:40,347:INFO:[01/May/2024:10:12:40] ENGINE Bus STARTING +2024-05-01 10:12:40,348:INFO:[01/May/2024:10:12:40] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:12:40,569:INFO:[01/May/2024:10:12:40] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:12:40,570:INFO:[01/May/2024:10:12:40] ENGINE Bus STARTED +2024-05-01 10:12:40,662:INFO:[01/May/2024:10:12:40] ENGINE Bus STARTING +2024-05-01 10:12:40,662:INFO:[01/May/2024:10:12:40] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:12:41,789:ERROR:[01/May/2024:10:12:41] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-01 10:12:41,789:ERROR:[01/May/2024:10:12:41] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE Bus STOPPING +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE Bus STOPPED +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE Bus EXITING +2024-05-01 10:12:41,789:INFO:[01/May/2024:10:12:41] ENGINE Bus EXITED +2024-05-01 10:12:46,889:INFO:127.0.0.1 - - [01/May/2024:10:12:46] "GET /bcc HTTP/1.1" 200 75 "" "PostmanRuntime/7.37.3" +2024-05-01 10:14:57,116:INFO:[01/May/2024:10:14:57] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:14:57,116:INFO:[01/May/2024:10:14:57] ENGINE Bus STOPPING +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE Bus STOPPED +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE Bus EXITING +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE Bus EXITED +2024-05-01 10:14:57,301:INFO:[01/May/2024:10:14:57] ENGINE Waiting for child threads to terminate... +2024-05-01 10:15:17,851:INFO:[01/May/2024:10:15:17] ENGINE Bus STARTING +2024-05-01 10:15:17,851:INFO:[01/May/2024:10:15:17] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:15:18,066:INFO:[01/May/2024:10:15:18] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:15:18,067:INFO:[01/May/2024:10:15:18] ENGINE Bus STARTED +2024-05-01 10:15:21,246:INFO:127.0.0.1 - - [01/May/2024:10:15:21] "GET /bcc HTTP/1.1" 200 75 "" "PostmanRuntime/7.37.3" +2024-05-01 10:15:30,696:INFO:[01/May/2024:10:15:30] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:15:30,697:INFO:[01/May/2024:10:15:30] ENGINE Bus STOPPING +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE Bus STOPPED +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE Bus EXITING +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE Bus EXITED +2024-05-01 10:15:30,856:INFO:[01/May/2024:10:15:30] ENGINE Waiting for child threads to terminate... +2024-05-01 10:15:50,440:INFO:[01/May/2024:10:15:50] ENGINE Bus STARTING +2024-05-01 10:15:50,440:INFO:[01/May/2024:10:15:50] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:15:50,660:INFO:[01/May/2024:10:15:50] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:15:50,661:INFO:[01/May/2024:10:15:50] ENGINE Bus STARTED +2024-05-01 10:15:53,747:INFO:127.0.0.1 - - [01/May/2024:10:15:53] "GET /bcc HTTP/1.1" 200 75 "" "PostmanRuntime/7.37.3" +2024-05-01 10:16:03,082:INFO:[01/May/2024:10:16:03] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:16:03,082:INFO:[01/May/2024:10:16:03] ENGINE Bus STOPPING +2024-05-01 10:16:03,268:INFO:[01/May/2024:10:16:03] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:16:03,270:INFO:[01/May/2024:10:16:03] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:16:03,270:INFO:[01/May/2024:10:16:03] ENGINE Bus STOPPED +2024-05-01 10:16:03,270:INFO:[01/May/2024:10:16:03] ENGINE Bus EXITING +2024-05-01 10:16:03,270:INFO:[01/May/2024:10:16:03] ENGINE Bus EXITED +2024-05-01 10:16:03,270:INFO:[01/May/2024:10:16:03] ENGINE Waiting for child threads to terminate... +2024-05-01 10:16:22,403:INFO:[01/May/2024:10:16:22] ENGINE Bus STARTING +2024-05-01 10:16:22,404:INFO:[01/May/2024:10:16:22] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:16:22,627:INFO:[01/May/2024:10:16:22] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:16:22,629:INFO:[01/May/2024:10:16:22] ENGINE Bus STARTED +2024-05-01 10:16:24,506:ERROR:[01/May/2024:10:16:24] HTTP +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 136, in __call__ + print(model.user_input) + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:16:24,594:INFO:[01/May/2024:10:16:24] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: b88fe603-927b-494e-9a5a-5adb3fdfc7d3 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:16:24,601:INFO:127.0.0.1 - - [01/May/2024:10:16:24] "GET /bcc HTTP/1.1" 500 1864 "" "PostmanRuntime/7.37.3" +2024-05-01 10:19:25,701:INFO:[01/May/2024:10:19:25] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:19:25,701:INFO:[01/May/2024:10:19:25] ENGINE Bus STOPPING +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE Bus STOPPED +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE Bus EXITING +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE Bus EXITED +2024-05-01 10:19:25,867:INFO:[01/May/2024:10:19:25] ENGINE Waiting for child threads to terminate... +2024-05-01 10:19:26,529:INFO:[01/May/2024:10:19:26] ENGINE Bus STARTING +2024-05-01 10:19:26,529:INFO:[01/May/2024:10:19:26] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:19:26,771:INFO:[01/May/2024:10:19:26] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:19:26,771:INFO:[01/May/2024:10:19:26] ENGINE Bus STARTED +2024-05-01 10:19:29,893:ERROR:[01/May/2024:10:19:29] HTTP +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 136, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:19:29,896:INFO:[01/May/2024:10:19:29] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: f6ad5278-c0aa-42cf-a55a-e962c3199b9a + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:19:29,897:INFO:127.0.0.1 - - [01/May/2024:10:19:29] "GET /bcc HTTP/1.1" 500 1864 "" "PostmanRuntime/7.37.3" +2024-05-01 10:20:13,131:INFO:[01/May/2024:10:20:13] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:20:13,131:INFO:[01/May/2024:10:20:13] ENGINE Bus STOPPING +2024-05-01 10:20:13,329:INFO:[01/May/2024:10:20:13] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:20:13,330:INFO:[01/May/2024:10:20:13] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:20:13,330:INFO:[01/May/2024:10:20:13] ENGINE Bus STOPPED +2024-05-01 10:20:13,330:INFO:[01/May/2024:10:20:13] ENGINE Bus EXITING +2024-05-01 10:20:13,330:INFO:[01/May/2024:10:20:13] ENGINE Bus EXITED +2024-05-01 10:20:13,330:INFO:[01/May/2024:10:20:13] ENGINE Waiting for child threads to terminate... +2024-05-01 10:20:13,912:INFO:[01/May/2024:10:20:13] ENGINE Bus STARTING +2024-05-01 10:20:13,913:INFO:[01/May/2024:10:20:13] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:20:14,134:INFO:[01/May/2024:10:20:14] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:20:14,134:INFO:[01/May/2024:10:20:14] ENGINE Bus STARTED +2024-05-01 10:20:17,992:INFO:127.0.0.1 - - [01/May/2024:10:20:17] "GET /bcc HTTP/1.1" 200 75 "" "PostmanRuntime/7.37.3" +2024-05-01 10:20:38,708:INFO:[01/May/2024:10:20:38] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:20:38,708:INFO:[01/May/2024:10:20:38] ENGINE Bus STOPPING +2024-05-01 10:20:38,884:INFO:[01/May/2024:10:20:38] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:20:38,884:INFO:[01/May/2024:10:20:38] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:20:38,884:INFO:[01/May/2024:10:20:38] ENGINE Bus STOPPED +2024-05-01 10:20:38,884:INFO:[01/May/2024:10:20:38] ENGINE Bus EXITING +2024-05-01 10:20:38,885:INFO:[01/May/2024:10:20:38] ENGINE Bus EXITED +2024-05-01 10:20:38,885:INFO:[01/May/2024:10:20:38] ENGINE Waiting for child threads to terminate... +2024-05-01 10:20:39,564:INFO:[01/May/2024:10:20:39] ENGINE Bus STARTING +2024-05-01 10:20:39,565:INFO:[01/May/2024:10:20:39] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:20:39,803:INFO:[01/May/2024:10:20:39] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:20:39,803:INFO:[01/May/2024:10:20:39] ENGINE Bus STARTED +2024-05-01 10:20:42,239:ERROR:[01/May/2024:10:20:42] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 143, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 153, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:20:42,241:INFO:[01/May/2024:10:20:42] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: a3a49a23-4531-4361-b1da-880d842273d9 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:20:42,241:INFO:127.0.0.1 - - [01/May/2024:10:20:42] "GET /bcc HTTP/1.1" 500 2198 "" "PostmanRuntime/7.37.3" +2024-05-01 10:20:58,045:INFO:[01/May/2024:10:20:58] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:20:58,045:INFO:[01/May/2024:10:20:58] ENGINE Bus STOPPING +2024-05-01 10:20:58,195:INFO:[01/May/2024:10:20:58] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:20:58,196:INFO:[01/May/2024:10:20:58] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:20:58,196:INFO:[01/May/2024:10:20:58] ENGINE Bus STOPPED +2024-05-01 10:20:58,196:INFO:[01/May/2024:10:20:58] ENGINE Bus EXITING +2024-05-01 10:20:58,196:INFO:[01/May/2024:10:20:58] ENGINE Bus EXITED +2024-05-01 10:20:58,196:INFO:[01/May/2024:10:20:58] ENGINE Waiting for child threads to terminate... +2024-05-01 10:20:58,907:INFO:[01/May/2024:10:20:58] ENGINE Bus STARTING +2024-05-01 10:20:58,908:INFO:[01/May/2024:10:20:58] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:20:59,122:INFO:[01/May/2024:10:20:59] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:20:59,123:INFO:[01/May/2024:10:20:59] ENGINE Bus STARTED +2024-05-01 10:21:02,471:ERROR:[01/May/2024:10:21:02] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 144, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:21:02,473:INFO:[01/May/2024:10:21:02] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 10c060c7-dacb-4118-82eb-d078482b1c68 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:21:02,475:INFO:127.0.0.1 - - [01/May/2024:10:21:02] "GET /bcc HTTP/1.1" 500 2198 "" "PostmanRuntime/7.37.3" +2024-05-01 10:21:17,668:ERROR:[01/May/2024:10:21:17] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 144, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:21:17,669:INFO:[01/May/2024:10:21:17] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 06703987-b295-4962-991e-ed40366df197 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:21:17,670:INFO:127.0.0.1 - - [01/May/2024:10:21:17] "GET /bcc HTTP/1.1" 500 2198 "" "PostmanRuntime/7.37.3" +2024-05-01 10:21:41,751:INFO:[01/May/2024:10:21:41] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-01 10:21:41,751:INFO:[01/May/2024:10:21:41] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:21:41,751:INFO:[01/May/2024:10:21:41] ENGINE Bus STOPPING +2024-05-01 10:21:41,900:INFO:[01/May/2024:10:21:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:21:41,900:INFO:[01/May/2024:10:21:41] ENGINE Bus STOPPED +2024-05-01 10:21:41,900:INFO:[01/May/2024:10:21:41] ENGINE Bus EXITING +2024-05-01 10:21:41,900:INFO:[01/May/2024:10:21:41] ENGINE Bus EXITED +2024-05-01 10:21:41,957:INFO:[01/May/2024:10:21:41] ENGINE Waiting for child threads to terminate... +2024-05-01 10:21:41,957:INFO:[01/May/2024:10:21:41] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-01 10:21:42,495:INFO:[01/May/2024:10:21:42] ENGINE Bus STARTING +2024-05-01 10:21:42,496:INFO:[01/May/2024:10:21:42] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:21:42,718:INFO:[01/May/2024:10:21:42] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:21:42,718:INFO:[01/May/2024:10:21:42] ENGINE Bus STARTED +2024-05-01 10:21:43,945:INFO:[01/May/2024:10:21:43] ENGINE Bus STARTING +2024-05-01 10:21:43,946:INFO:[01/May/2024:10:21:43] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:21:45,109:ERROR:[01/May/2024:10:21:45] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-01 10:21:45,109:ERROR:[01/May/2024:10:21:45] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-01 10:21:45,109:INFO:[01/May/2024:10:21:45] ENGINE Bus STOPPING +2024-05-01 10:21:45,109:INFO:[01/May/2024:10:21:45] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-01 10:21:45,110:INFO:[01/May/2024:10:21:45] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:21:45,110:INFO:[01/May/2024:10:21:45] ENGINE Bus STOPPED +2024-05-01 10:21:45,110:INFO:[01/May/2024:10:21:45] ENGINE Bus EXITING +2024-05-01 10:21:45,110:INFO:[01/May/2024:10:21:45] ENGINE Bus EXITED +2024-05-01 10:22:11,529:INFO:[01/May/2024:10:22:11] ENGINE Bus STARTING +2024-05-01 10:22:11,530:INFO:[01/May/2024:10:22:11] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:22:11,744:INFO:[01/May/2024:10:22:11] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:22:11,744:INFO:[01/May/2024:10:22:11] ENGINE Bus STARTED +2024-05-01 10:22:15,303:ERROR:[01/May/2024:10:22:15] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 145, in __call__ + model.converted_result = converted_result + ^^^^^^^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'converted_result' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + model.user_input = user_input + ^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:22:15,305:INFO:[01/May/2024:10:22:15] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 84c212c6-6e1d-4b6e-b1a7-277ad2c813c0 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:22:15,306:INFO:127.0.0.1 - - [01/May/2024:10:22:15] "GET /bcc HTTP/1.1" 500 2222 "" "PostmanRuntime/7.37.3" +2024-05-01 10:23:56,565:INFO:[01/May/2024:10:23:56] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:23:56,565:INFO:[01/May/2024:10:23:56] ENGINE Bus STOPPING +2024-05-01 10:23:56,728:INFO:[01/May/2024:10:23:56] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:23:56,728:INFO:[01/May/2024:10:23:56] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:23:56,729:INFO:[01/May/2024:10:23:56] ENGINE Bus STOPPED +2024-05-01 10:23:56,729:INFO:[01/May/2024:10:23:56] ENGINE Bus EXITING +2024-05-01 10:23:56,729:INFO:[01/May/2024:10:23:56] ENGINE Bus EXITED +2024-05-01 10:23:56,729:INFO:[01/May/2024:10:23:56] ENGINE Waiting for child threads to terminate... +2024-05-01 10:23:57,416:INFO:[01/May/2024:10:23:57] ENGINE Bus STARTING +2024-05-01 10:23:57,417:INFO:[01/May/2024:10:23:57] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:23:57,655:INFO:[01/May/2024:10:23:57] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:23:57,656:INFO:[01/May/2024:10:23:57] ENGINE Bus STARTED +2024-05-01 10:23:59,990:ERROR:[01/May/2024:10:23:59] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 145, in __call__ + m.converted_result = converted_result + ^^^^^^^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'converted_result' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + m.user_input = user_input + ^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:23:59,994:INFO:[01/May/2024:10:23:59] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: c40dc57d-78ad-4dbb-96ab-e6db672c9f96 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:23:59,995:INFO:127.0.0.1 - - [01/May/2024:10:23:59] "GET /bcc HTTP/1.1" 500 2206 "" "PostmanRuntime/7.37.3" +2024-05-01 10:24:56,259:INFO:[01/May/2024:10:24:56] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:24:56,259:INFO:[01/May/2024:10:24:56] ENGINE Bus STOPPING +2024-05-01 10:24:56,423:INFO:[01/May/2024:10:24:56] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:24:56,423:INFO:[01/May/2024:10:24:56] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:24:56,424:INFO:[01/May/2024:10:24:56] ENGINE Bus STOPPED +2024-05-01 10:24:56,424:INFO:[01/May/2024:10:24:56] ENGINE Bus EXITING +2024-05-01 10:24:56,424:INFO:[01/May/2024:10:24:56] ENGINE Bus EXITED +2024-05-01 10:24:56,424:INFO:[01/May/2024:10:24:56] ENGINE Waiting for child threads to terminate... +2024-05-01 10:24:57,109:INFO:[01/May/2024:10:24:57] ENGINE Bus STARTING +2024-05-01 10:24:57,109:INFO:[01/May/2024:10:24:57] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:24:57,320:INFO:[01/May/2024:10:24:57] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:24:57,321:INFO:[01/May/2024:10:24:57] ENGINE Bus STARTED +2024-05-01 10:24:59,593:ERROR:[01/May/2024:10:24:59] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 148, in __call__ + self.dbops.save_to_db(m, converted_result) + File "C:\Users\71524\PackageMeasurementConversionAPI\utilis\database_operations.py", line 30, in save_to_db + (m.user_input, m.converted_result, m.status, "")) + ^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + m.user_input = user_input + ^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:24:59,595:INFO:[01/May/2024:10:24:59] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: b2d39e0c-f659-4ff1-bb65-f82102d7e397 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:24:59,597:INFO:127.0.0.1 - - [01/May/2024:10:24:59] "GET /bcc HTTP/1.1" 500 2364 "" "PostmanRuntime/7.37.3" +2024-05-01 10:25:42,321:INFO:[01/May/2024:10:25:42] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:25:42,322:INFO:[01/May/2024:10:25:42] ENGINE Bus STOPPING +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE Bus STOPPED +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE Bus EXITING +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE Bus EXITED +2024-05-01 10:25:42,485:INFO:[01/May/2024:10:25:42] ENGINE Waiting for child threads to terminate... +2024-05-01 10:31:31,685:INFO:[01/May/2024:10:31:31] ENGINE Bus STARTING +2024-05-01 10:31:31,686:INFO:[01/May/2024:10:31:31] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:31:31,899:INFO:[01/May/2024:10:31:31] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:31:31,900:INFO:[01/May/2024:10:31:31] ENGINE Bus STARTED +2024-05-01 10:31:35,279:ERROR:[01/May/2024:10:31:35] HTTP +Traceback (most recent call last): + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 148, in __call__ + self.dbops.save_to_db(m, converted_result) + File "C:\Users\71524\PackageMeasurementConversionAPI\utilis\database_operations.py", line 30, in save_to_db + (m.user_input, m.converted_result, m.status, "")) + ^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py", line 154, in __call__ + m.user_input = user_input + ^^^^^^^^^^^^ +AttributeError: 'str' object has no attribute 'user_input' +2024-05-01 10:31:35,387:INFO:[01/May/2024:10:31:35] HTTP +Request Headers: + Remote-Addr: 127.0.0.1 + USER-AGENT: PostmanRuntime/7.37.3 + ACCEPT: */* + POSTMAN-TOKEN: 2980cdd4-db00-4364-9e2b-f6e1be649984 + HOST: localhost:8080 + ACCEPT-ENCODING: gzip, deflate, br + CONNECTION: keep-alive + Content-Type: application/json + Content-Length: 31 +2024-05-01 10:31:35,391:INFO:127.0.0.1 - - [01/May/2024:10:31:35] "GET /bcc HTTP/1.1" 500 2364 "" "PostmanRuntime/7.37.3" +2024-05-01 10:34:57,758:INFO:[01/May/2024:10:34:57] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:34:57,759:INFO:[01/May/2024:10:34:57] ENGINE Bus STOPPING +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE Bus STOPPED +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE Bus EXITING +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE Bus EXITED +2024-05-01 10:34:57,889:INFO:[01/May/2024:10:34:57] ENGINE Waiting for child threads to terminate... +2024-05-01 10:34:58,444:INFO:[01/May/2024:10:34:58] ENGINE Bus STARTING +2024-05-01 10:34:58,445:INFO:[01/May/2024:10:34:58] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:34:58,676:INFO:[01/May/2024:10:34:58] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:34:58,677:INFO:[01/May/2024:10:34:58] ENGINE Bus STARTED +2024-05-01 10:35:01,650:INFO:127.0.0.1 - - [01/May/2024:10:35:01] "GET /bcc HTTP/1.1" 200 103 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:37,055:INFO:[01/May/2024:10:35:37] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:35:37,055:INFO:[01/May/2024:10:35:37] ENGINE Bus STOPPING +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE Bus STOPPED +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE Bus EXITING +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE Bus EXITED +2024-05-01 10:35:37,241:INFO:[01/May/2024:10:35:37] ENGINE Waiting for child threads to terminate... +2024-05-01 10:35:37,914:INFO:[01/May/2024:10:35:37] ENGINE Bus STARTING +2024-05-01 10:35:37,916:INFO:[01/May/2024:10:35:37] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 10:35:38,130:INFO:[01/May/2024:10:35:38] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 10:35:38,130:INFO:[01/May/2024:10:35:38] ENGINE Bus STARTED +2024-05-01 10:35:40,642:INFO:127.0.0.1 - - [01/May/2024:10:35:40] "GET /bcc HTTP/1.1" 200 51 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:47,852:INFO:127.0.0.1 - - [01/May/2024:10:35:47] "GET /abbcc HTTP/1.1" 200 54 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:51,611:INFO:127.0.0.1 - - [01/May/2024:10:35:51] "GET /aaa HTTP/1.1" 200 63 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:54,219:INFO:127.0.0.1 - - [01/May/2024:10:35:54] "GET /aa HTTP/1.1" 200 51 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:56,738:INFO:127.0.0.1 - - [01/May/2024:10:35:56] "GET /ge HTTP/1.1" 200 63 "" "PostmanRuntime/7.37.3" +2024-05-01 10:35:59,279:INFO:127.0.0.1 - - [01/May/2024:10:35:59] "GET /get_history HTTP/1.1" 200 2080 "" "PostmanRuntime/7.37.3" +2024-05-01 10:36:08,049:INFO:[01/May/2024:10:36:08] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 10:36:08,049:INFO:[01/May/2024:10:36:08] ENGINE Bus STOPPING +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Bus STOPPED +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Bus EXITING +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Bus EXITED +2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Waiting for child threads to terminate... diff --git a/main_app.py b/main_app.py index 1f2a112..5446524 100644 --- a/main_app.py +++ b/main_app.py @@ -2,7 +2,7 @@ import sys import logging -from controller.handlers import MeasurementConversionHandler +from controller.conversion_controller import ConversionController if __name__ == '__main__': port = 8080 # Default port @@ -19,7 +19,7 @@ format='%(asctime)s:%(levelname)s:%(message)s') # Mount the MeasurementConversionHandler to the CherryPy root - cherrypy.tree.mount(MeasurementConversionHandler(), '/') + cherrypy.tree.mount(ConversionController(), '/') cherrypy.config.update({'server.socket_host': '0.0.0.0', 'server.socket_port': port}) # Start the CherryPy server diff --git a/measurements.db b/measurements.db index 72b1d700fafea00861239e92697cfc4c0710376d..ffdb328e305f6b6abfbe34996f645e40d9dca076 100644 GIT binary patch delta 463 zcmZojXh@hK%_ufe#+gxUW5N=CJyG5#4EzuI_wujipUL0IpULmbZ^$po&&+q9?=0Us zz8=03z7#%xK2tt1J|^BL8w)q_*2{>pF$k(l^QNbI=9MMpWTq%&<`tBd1cy31y9Ngf zi2!AVrFjz*qYY!BVzR<)48lMiiHV8Wv`7fCF^Ee7rIV79lcSAv6wF{6g$02cfrf#^ zVS@F+d;&mGUU879YfzAXkQhHuzbI5cNITS81wJ+gNszT5bCa>zEXxaZSQ1ug0Un@V z_(ASAgc_;D%{KXfykflo7rKlTC(tr!sAcgWSLi4hKy^uR;E`j;Ehol?-D6^#o8)T+ G7)1fj5^{?G delta 44 zcmZojXh@hK&B!)U#+i|AW5N=CK34ul2L6Zqd-+%M&*X31EU1vrzqwJqPJodW04CuK A$N&HU diff --git a/models/database_initializer.py b/models/database_initializer.py new file mode 100644 index 0000000..c5c6911 --- /dev/null +++ b/models/database_initializer.py @@ -0,0 +1,18 @@ +import sqlite3 + + +def init_db(): + """ + A function to initialize the SQLite database + :return: The database connection object + """ + conn = sqlite3.connect('measurements.db') + cursor = conn.cursor() + cursor.execute('''CREATE TABLE IF NOT EXISTS conversions + (id INTEGER PRIMARY KEY AUTOINCREMENT, + user_input TEXT, + converted_result TEXT, + status TEXT, + error_message TEXT)''') + conn.commit() + return conn diff --git a/models/sequence_output.py b/models/sequence_output.py new file mode 100644 index 0000000..fbab7b9 --- /dev/null +++ b/models/sequence_output.py @@ -0,0 +1,7 @@ +class SequenceOutput: + + def __init__(self, user_input, converted_result, status, error_message): + self.user_input = user_input + self.converted_result = converted_result + self.status = status + self.error_message = error_message diff --git a/services/__init__.py b/services/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/conversion.py b/services/conversion_service.py similarity index 100% rename from models/conversion.py rename to services/conversion_service.py diff --git a/test_conversion.py b/test_conversion.py index c1b5707..d3b1b93 100644 --- a/test_conversion.py +++ b/test_conversion.py @@ -1,6 +1,6 @@ import unittest -from models.conversion import Conversion +from services.conversion_service import Conversion class TestConversion(unittest.TestCase): diff --git a/utilis/__init__.py b/utilis/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utilis/__pycache__/__init__.cpython-312.pyc b/utilis/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b90c68177a183eff8119cd44a020b8d6c3aed6d GIT binary patch literal 162 zcmX@j%ge<81fQ=Nrh(|kAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxd<>+h`6Iz^FR2*Y& zXli5<6OfpkotU2Lo0?c$T9lfbnpfhSpH~Ky&&KuERKnf&&! z&+OT7I$F0vs;#Aq@o0;GDoB6c0wFSZR&p!@je-TFLPvXUY6i-?I9w-aQKn5nI8j3=-YHcO_h8J9q9OVP_^TFTIK zWqZ18XX^HK=?zBf1Mt3pC`w}kr6npGcplyJEYpf1Q8gA^uC?QqeZ6V&1B-wH)BW6YHoNg0FZD!Idl*20}hBtMRu}URc zH?uC~LF*@a$sl4UOub-M%+eGwZDM9!$w|qw$uy&!mh48TVenmMrD2lX#c#vfQAEsy z>V$JT*KM0QO_>~JY<7CqdC1N&svDX}kBPNsVxqrB>tdRlV<(0uU*@oPliwXWcI4>f zi+bh<`V>7&bzWw)2q^`7n|$%~WZ5hv#kYS5w2gM z0_rf$38fEydnI)j8e$Ts24Grp} zT!0>K>voy<6F|4cv?Apk;JPzPJ*i;WFsTC)dZ1{9Bk;pSFpCkub5M5`34(3~jbM*& z!~gmb5NBXv1gtJb5t_pRdsVT&#c$vRjM2?K3YtZ~kzx6;U||`eB_u~0_?DxXHZ5|& zc7!moyPM4;Q?x{9rrGhza6Qd$Cei`1-kNPefenlltc+gZ#|Ii?yTKLT2jb7@@7K`p z`zJm+`hM!eeIJ}(?w|Mv7qj?DM;upvbb35B`qBhBJw9=6%ieL)_kS#VqOtBiLvC+h zNshfdnj(GA_7m?f;lQcX!eIH36Uvksx0usnahc-&|2?-Up@2A zGq4d$CsHf@6QA`?EXBxLr2W?Tjqw`7`;UFGzvu4Qow4^GUp+Xod~oC={dc+F=01^@ zy3agNrPi~!7DBCiZk@St=H}UrC`8&2;l31NlMCLso&5fDarxu8`Wy*wL$9DLmk|F7 z$^x1K)HeTjT9m5NuCyphR zdXX(Q(S4poEHbB5m5g*AE=6<750#YHUd2~E`-EKiaRZy%Ny|U8w}7AI0CX0cC0S+_ z{{wsZ$MG1L5-a;nqv5QC+W>FGt#qbF$3{;~kb~sZOXtpR8N$aCs#^mtD%pORm(!G` zb|$A63QqIrOomR2TLxG?F204m1Op^HnC=8~%%7R&SyvA43hABZA`-t00)X9u_I6wk z*Q8K$$J(Bbh3?zkul3ZB+}i*4lWUzlcf0R&zt!_7))zzaHwBz+lU7G*AK!d*7+5};CAo6pTF>RO$K$74@1=XSh5Gbek2)_ z7eh^;F2>YkS9q~Q7J8Q}dzzC+~b`g+B#i9(|$i`BDn2 ziFFx;+G|3qwYREWZ;r1cXx1NXQ{#0HVoV~$#7*DnhKy)|4>WE~jjJG>Vxl~qhdm4b zSkx@{j?UZ!-8{DEw%IgNpXG5j2;)WBalvq~pcwxFML$P_pQE9TPy)xlLLl6n{smBZ B1&ROw literal 0 HcmV?d00001 diff --git a/controller/app_controllers.py b/utilis/database_operations.py similarity index 53% rename from controller/app_controllers.py rename to utilis/database_operations.py index 51f77d2..f87352e 100644 --- a/controller/app_controllers.py +++ b/utilis/database_operations.py @@ -1,30 +1,9 @@ -import sqlite3 import cherrypy -from models.conversion import Conversion +from models.database_initializer import init_db +from models.sequence_output import SequenceOutput -def init_db(): - """ - A function to initialize the SQLite database - :return: The database connection object - """ - conn = sqlite3.connect('measurements.db') - cursor = conn.cursor() - cursor.execute('''CREATE TABLE IF NOT EXISTS conversions - (id INTEGER PRIMARY KEY AUTOINCREMENT, - user_input TEXT, - converted_result TEXT, - status TEXT, - error_message TEXT)''') - conn.commit() - return conn - - -class MeasurementConversion: - exposed = True - - def __init__(self): - self.converter = Conversion() # Instantiate the Conversion class +class ConversionDatabaseOperations: @staticmethod def get_db(): @@ -36,21 +15,11 @@ def get_db(): cherrypy.thread_data.conn = init_db() return cherrypy.thread_data.conn - def convert_input(self, user_input): - """ - A function to convert the user input to the list of values - :param user_input: User input string - :return: Converted result string or list - """ - converted_result = self.converter.converted_string(user_input) # Use the converted_string method - return converted_result - - def save_to_db(self, user_input, converted_result, status): + def save_to_db(self, m: SequenceOutput, converted_result): """ A function to save conversion data to the database - :param user_input: User input string + :param m: User sequence object containing user_input, converted_result, status, error_message :param converted_result: Converted result string or list - :param status: Status of the conversion """ with self.get_db() as conn: cursor = conn.cursor() @@ -58,7 +27,7 @@ def save_to_db(self, user_input, converted_result, status): converted_result = ', '.join(str(item) for item in converted_result) cursor.execute('''INSERT INTO conversions (user_input, converted_result, status, error_message) VALUES (?, ?, ?, ?)''', - (user_input, converted_result, status, "")) + (m.user_input, m.converted_result, m.status, "")) conn.commit() def retrieve_history(self): From 8832d1813e1dcba3d70cc1ea216e1af45c2798d4 Mon Sep 17 00:00:00 2001 From: Sara Yasser Amur Al Shukaili <71524@omantel.om> Date: Wed, 1 May 2024 10:47:16 +0400 Subject: [PATCH 3/5] Edited logic for measurement conversion --- .gitignore | 8 ++++++++ utilis/__pycache__/__init__.cpython-312.pyc | Bin 162 -> 0 bytes .../database_operations.cpython-312.pyc | Bin 3193 -> 0 bytes 3 files changed, 8 insertions(+) create mode 100644 .gitignore delete mode 100644 utilis/__pycache__/__init__.cpython-312.pyc delete mode 100644 utilis/__pycache__/database_operations.cpython-312.pyc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7829364 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.idea/ +*.png +*.jpg +*.gif +*.txt +*.csv +*.pdf +**/__pycache__/ \ No newline at end of file diff --git a/utilis/__pycache__/__init__.cpython-312.pyc b/utilis/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 7b90c68177a183eff8119cd44a020b8d6c3aed6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmX@j%ge<81fQ=Nrh(|kAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxd<>+h`6Iz^FR2*Y& zXli5<6OfpkotU2Lo0?c$T9lfbnpfhSpH~Ky&&KuERKnf&&! z&+OT7I$F0vs;#Aq@o0;GDoB6c0wFSZR&p!@je-TFLPvXUY6i-?I9w-aQKn5nI8j3=-YHcO_h8J9q9OVP_^TFTIK zWqZ18XX^HK=?zBf1Mt3pC`w}kr6npGcplyJEYpf1Q8gA^uC?QqeZ6V&1B-wH)BW6YHoNg0FZD!Idl*20}hBtMRu}URc zH?uC~LF*@a$sl4UOub-M%+eGwZDM9!$w|qw$uy&!mh48TVenmMrD2lX#c#vfQAEsy z>V$JT*KM0QO_>~JY<7CqdC1N&svDX}kBPNsVxqrB>tdRlV<(0uU*@oPliwXWcI4>f zi+bh<`V>7&bzWw)2q^`7n|$%~WZ5hv#kYS5w2gM z0_rf$38fEydnI)j8e$Ts24Grp} zT!0>K>voy<6F|4cv?Apk;JPzPJ*i;WFsTC)dZ1{9Bk;pSFpCkub5M5`34(3~jbM*& z!~gmb5NBXv1gtJb5t_pRdsVT&#c$vRjM2?K3YtZ~kzx6;U||`eB_u~0_?DxXHZ5|& zc7!moyPM4;Q?x{9rrGhza6Qd$Cei`1-kNPefenlltc+gZ#|Ii?yTKLT2jb7@@7K`p z`zJm+`hM!eeIJ}(?w|Mv7qj?DM;upvbb35B`qBhBJw9=6%ieL)_kS#VqOtBiLvC+h zNshfdnj(GA_7m?f;lQcX!eIH36Uvksx0usnahc-&|2?-Up@2A zGq4d$CsHf@6QA`?EXBxLr2W?Tjqw`7`;UFGzvu4Qow4^GUp+Xod~oC={dc+F=01^@ zy3agNrPi~!7DBCiZk@St=H}UrC`8&2;l31NlMCLso&5fDarxu8`Wy*wL$9DLmk|F7 z$^x1K)HeTjT9m5NuCyphR zdXX(Q(S4poEHbB5m5g*AE=6<750#YHUd2~E`-EKiaRZy%Ny|U8w}7AI0CX0cC0S+_ z{{wsZ$MG1L5-a;nqv5QC+W>FGt#qbF$3{;~kb~sZOXtpR8N$aCs#^mtD%pORm(!G` zb|$A63QqIrOomR2TLxG?F204m1Op^HnC=8~%%7R&SyvA43hABZA`-t00)X9u_I6wk z*Q8K$$J(Bbh3?zkul3ZB+}i*4lWUzlcf0R&zt!_7))zzaHwBz+lU7G*AK!d*7+5};CAo6pTF>RO$K$74@1=XSh5Gbek2)_ z7eh^;F2>YkS9q~Q7J8Q}dzzC+~b`g+B#i9(|$i`BDn2 ziFFx;+G|3qwYREWZ;r1cXx1NXQ{#0HVoV~$#7*DnhKy)|4>WE~jjJG>Vxl~qhdm4b zSkx@{j?UZ!-8{DEw%IgNpXG5j2;)WBalvq~pcwxFML$P_pQE9TPy)xlLLl6n{smBZ B1&ROw From d48a7707f22d8d4166c7a696a1c320533d6a9fb6 Mon Sep 17 00:00:00 2001 From: Sara Yasser Amur Al Shukaili <71524@omantel.om> Date: Thu, 2 May 2024 10:08:27 +0400 Subject: [PATCH 4/5] Edited the output --- controller/conversion_controller.py | 93 +--- error_logs.log | 766 ++++++++++++++++++++++++++++ measurements.db | Bin 12288 -> 20480 bytes services/conversion_service.py | 13 +- test_conversion.py | 8 +- 5 files changed, 782 insertions(+), 98 deletions(-) diff --git a/controller/conversion_controller.py b/controller/conversion_controller.py index d0add8e..8bb2234 100644 --- a/controller/conversion_controller.py +++ b/controller/conversion_controller.py @@ -1,90 +1,3 @@ -# import json -# import cherrypy -# from services.conversion_service import Conversion -# # from controller.app_controllers import MeasurementConversion -# from models.database_initializer import init_db -# from utilis.database_operations import ConversionDatabaseOperations -# -# -# class ConversionController: -# exposed = True -# -# class MeasurementConversion: -# -# def __init__(self): -# self.converter = Conversion() # Instantiate the Conversion class -# -# def convert_input(self, user_input): -# """ -# A function to convert the user input to the list of values -# :param user_input: User input string -# :return: Converted result string or list -# """ -# converted_result = self.converter.converted_string(user_input) # Use the converted_string method -# return converted_result -# -# def __init__(self): -# self.controller = ConversionController.MeasurementConversion() -# self.conversion = Conversion() -# self.dbops = ConversionDatabaseOperations() -# -# @staticmethod -# def get_db(): -# """ -# A function that retrieves the database connection object, and initializing it if it is not present -# :return: A database connection object -# """ -# if not hasattr(cherrypy.thread_data, 'conn'): -# cherrypy.thread_data.conn = init_db() -# return cherrypy.thread_data.conn -# -# @cherrypy.tools.json_out() -# def __call__(self, user_input=None): -# """ -# A function that exposes an endpoint to convert user's input to a converted list of values as JSON -# :param user_input: A sequence of characters that is None by default -# :return: A JSON response containing the conversion result, status, and error message -# """ -# res_msg = {"status": "SUCCESS", "err_msg": "", "result": ""} -# try: -# if not user_input: -# user_input = cherrypy.request.params.get('user_input') -# if user_input is not None: -# converted_result = self.conversion.converted_string(user_input) -# self.dbops.save_to_db(user_input, converted_result, "SUCCESS") -# res_msg["result"] = converted_result -# else: -# res_msg["status"] = "FAIL" -# res_msg["result"] = "Missing user_input parameter" -# except Exception as e: -# self.dbops.save_to_db(user_input, "", "ERROR") -# res_msg["status"] = "ERROR" -# res_msg["result"] = str(e) -# -# return json.dumps(res_msg) -# -# @cherrypy.expose -# @cherrypy.tools.json_out() -# def get_history(self): -# """ -# A function that exposes an endpoint to retrieve conversions history -# :return: A JSON response containing conversion history -# """ -# res_msg = {"status": "SUCCESS", "err_msg": "", "history": []} -# try: -# with self.get_db() as conn: -# cursor = conn.cursor() -# # Retrieve conversion history from SQLite -# cursor.execute('''SELECT * FROM conversions''') -# history = cursor.fetchall() -# res_msg["history"] = [ -# {"user_input": row[1], "converted_result": row[2], "status": row[3], "error_message": row[4]} for -# row in history] -# except Exception as e: -# res_msg["status"] = "ERROR" -# res_msg["err_msg"] = str(e) -# return res_msg - import json import cherrypy from services.conversion_service import Conversion @@ -94,7 +7,6 @@ class ConversionController: - exposed = True class MeasurementConversion: @@ -125,8 +37,9 @@ def get_db(): cherrypy.thread_data.conn = init_db() return cherrypy.thread_data.conn + @cherrypy.expose @cherrypy.tools.json_out() - def __call__(self, user_input=None): + def convert(self, user_input=None): """ A function that exposes an endpoint to convert user's input to a converted list of values as JSON :param user_input: A sequence of characters that is None by default @@ -157,7 +70,7 @@ def __call__(self, user_input=None): res_msg["status"] = "ERROR" res_msg["result"] = str(e) - return json.dumps(res_msg) + return res_msg @cherrypy.expose @cherrypy.tools.json_out() diff --git a/error_logs.log b/error_logs.log index 184b7f6..f123d7d 100644 --- a/error_logs.log +++ b/error_logs.log @@ -931,3 +931,769 @@ Request Headers: 2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Bus EXITING 2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Bus EXITED 2024-05-01 10:36:08,222:INFO:[01/May/2024:10:36:08] ENGINE Waiting for child threads to terminate... +2024-05-01 14:22:22,709:INFO:[01/May/2024:14:22:22] ENGINE Bus STARTING +2024-05-01 14:22:22,710:INFO:[01/May/2024:14:22:22] ENGINE Started monitor thread 'Autoreloader'. +2024-05-01 14:22:22,936:INFO:[01/May/2024:14:22:22] ENGINE Serving on http://0.0.0.0:8080 +2024-05-01 14:22:22,936:INFO:[01/May/2024:14:22:22] ENGINE Bus STARTED +2024-05-01 14:25:34,738:INFO:192.168.137.1 - - [01/May/2024:14:25:34] "GET /?user_input=asdasd HTTP/1.1" 200 63 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-01 14:25:35,149:INFO:192.168.137.1 - - [01/May/2024:14:25:35] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=asdasd" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-01 14:31:47,243:INFO:192.168.137.1 - - [01/May/2024:14:31:47] "GET /?user_input=asdasd HTTP/1.1" 200 63 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-01 14:35:10,673:INFO:[01/May/2024:14:35:10] ENGINE Keyboard Interrupt: shutting down bus +2024-05-01 14:35:10,673:INFO:[01/May/2024:14:35:10] ENGINE Bus STOPPING +2024-05-01 14:35:10,799:INFO:[01/May/2024:14:35:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-01 14:35:10,799:INFO:[01/May/2024:14:35:10] ENGINE Stopped thread 'Autoreloader'. +2024-05-01 14:35:10,800:INFO:[01/May/2024:14:35:10] ENGINE Bus STOPPED +2024-05-01 14:35:10,800:INFO:[01/May/2024:14:35:10] ENGINE Bus EXITING +2024-05-01 14:35:10,800:INFO:[01/May/2024:14:35:10] ENGINE Bus EXITED +2024-05-01 14:35:10,800:INFO:[01/May/2024:14:35:10] ENGINE Waiting for child threads to terminate... +2024-05-02 08:46:57,925:INFO:[02/May/2024:08:46:57] ENGINE Bus STARTING +2024-05-02 08:46:57,926:INFO:[02/May/2024:08:46:57] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:46:58,144:INFO:[02/May/2024:08:46:58] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:46:58,145:INFO:[02/May/2024:08:46:58] ENGINE Bus STARTED +2024-05-02 08:46:59,977:INFO:192.168.137.1 - - [02/May/2024:08:46:59] "GET /?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:47:02,543:INFO:192.168.137.1 - - [02/May/2024:08:47:02] "GET /?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:47:35,463:INFO:192.168.137.1 - - [02/May/2024:08:47:35] "GET /?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:47:35,691:INFO:192.168.137.1 - - [02/May/2024:08:47:35] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:48:51,034:INFO:[02/May/2024:08:48:51] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 08:48:51,034:INFO:[02/May/2024:08:48:51] ENGINE Bus STOPPING +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE Bus STOPPED +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE Bus EXITING +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE Bus EXITED +2024-05-02 08:48:51,219:INFO:[02/May/2024:08:48:51] ENGINE Waiting for child threads to terminate... +2024-05-02 08:48:51,859:INFO:[02/May/2024:08:48:51] ENGINE Bus STARTING +2024-05-02 08:48:51,862:INFO:[02/May/2024:08:48:51] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:48:52,090:INFO:[02/May/2024:08:48:52] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:48:52,090:INFO:[02/May/2024:08:48:52] ENGINE Bus STARTED +2024-05-02 08:48:58,642:INFO:192.168.137.1 - - [02/May/2024:08:48:58] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:48:58,825:INFO:192.168.137.1 - - [02/May/2024:08:48:58] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:49:00,589:INFO:192.168.137.1 - - [02/May/2024:08:49:00] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:49:00,772:INFO:192.168.137.1 - - [02/May/2024:08:49:00] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:09,721:INFO:192.168.137.1 - - [02/May/2024:08:50:09] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:09,895:INFO:192.168.137.1 - - [02/May/2024:08:50:09] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:11,858:INFO:192.168.137.1 - - [02/May/2024:08:50:11] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:12,150:INFO:192.168.137.1 - - [02/May/2024:08:50:12] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:12,973:INFO:192.168.137.1 - - [02/May/2024:08:50:12] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,165:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,262:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,396:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,480:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,587:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,742:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:13,857:INFO:192.168.137.1 - - [02/May/2024:08:50:13] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:50:29,588:INFO:[02/May/2024:08:50:29] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 08:50:29,589:INFO:[02/May/2024:08:50:29] ENGINE Bus STOPPING +2024-05-02 08:50:29,778:INFO:[02/May/2024:08:50:29] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 08:50:29,778:INFO:[02/May/2024:08:50:29] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 08:50:29,779:INFO:[02/May/2024:08:50:29] ENGINE Bus STOPPED +2024-05-02 08:50:29,779:INFO:[02/May/2024:08:50:29] ENGINE Bus EXITING +2024-05-02 08:50:29,779:INFO:[02/May/2024:08:50:29] ENGINE Bus EXITED +2024-05-02 08:50:29,779:INFO:[02/May/2024:08:50:29] ENGINE Waiting for child threads to terminate... +2024-05-02 08:50:48,175:INFO:[02/May/2024:08:50:48] ENGINE Bus STARTING +2024-05-02 08:50:48,176:INFO:[02/May/2024:08:50:48] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:50:48,394:INFO:[02/May/2024:08:50:48] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:50:48,395:INFO:[02/May/2024:08:50:48] ENGINE Bus STARTED +2024-05-02 08:51:27,980:INFO:192.168.137.1 - - [02/May/2024:08:51:27] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:51:32,427:INFO:192.168.137.1 - - [02/May/2024:08:51:32] "GET /?user_input=aa HTTP/1.1" 200 19 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:51:32,634:INFO:192.168.137.1 - - [02/May/2024:08:51:32] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:52:19,003:INFO:[02/May/2024:08:52:19] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 08:52:19,003:INFO:[02/May/2024:08:52:19] ENGINE Bus STOPPING +2024-05-02 08:52:19,185:INFO:[02/May/2024:08:52:19] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 08:52:19,186:INFO:[02/May/2024:08:52:19] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 08:52:19,187:INFO:[02/May/2024:08:52:19] ENGINE Bus STOPPED +2024-05-02 08:52:19,187:INFO:[02/May/2024:08:52:19] ENGINE Bus EXITING +2024-05-02 08:52:19,188:INFO:[02/May/2024:08:52:19] ENGINE Bus EXITED +2024-05-02 08:52:19,188:INFO:[02/May/2024:08:52:19] ENGINE Waiting for child threads to terminate... +2024-05-02 08:53:36,179:INFO:[02/May/2024:08:53:36] ENGINE Bus STARTING +2024-05-02 08:53:36,181:INFO:[02/May/2024:08:53:36] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:53:36,394:INFO:[02/May/2024:08:53:36] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:53:36,395:INFO:[02/May/2024:08:53:36] ENGINE Bus STARTED +2024-05-02 08:54:56,037:INFO:192.168.137.1 - - [02/May/2024:08:54:56] "GET /?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:54:56,409:INFO:192.168.137.1 - - [02/May/2024:08:54:56] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:54:59,581:INFO:[02/May/2024:08:54:59] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 08:54:59,581:INFO:[02/May/2024:08:54:59] ENGINE Bus STOPPING +2024-05-02 08:54:59,727:INFO:[02/May/2024:08:54:59] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 08:54:59,728:INFO:[02/May/2024:08:54:59] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 08:54:59,728:INFO:[02/May/2024:08:54:59] ENGINE Bus STOPPED +2024-05-02 08:54:59,728:INFO:[02/May/2024:08:54:59] ENGINE Bus EXITING +2024-05-02 08:54:59,729:INFO:[02/May/2024:08:54:59] ENGINE Bus EXITED +2024-05-02 08:54:59,729:INFO:[02/May/2024:08:54:59] ENGINE Waiting for child threads to terminate... +2024-05-02 08:55:03,669:INFO:[02/May/2024:08:55:03] ENGINE Bus STARTING +2024-05-02 08:55:03,670:INFO:[02/May/2024:08:55:03] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:55:03,889:INFO:[02/May/2024:08:55:03] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:55:03,890:INFO:[02/May/2024:08:55:03] ENGINE Bus STARTED +2024-05-02 08:55:08,084:ERROR:[02/May/2024:08:55:08] HTTP +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 799, in __set__ + raise ValueError(self.unicode_err) +ValueError: Page handlers MUST return bytes. Use tools.encode if you wish to return unicode. +2024-05-02 08:55:08,086:INFO:[02/May/2024:08:55:08] HTTP +Request Headers: + Remote-Addr: 192.168.137.1 + HOST: 192.168.137.182:8080 + CONNECTION: keep-alive + PRAGMA: no-cache + CACHE-CONTROL: no-cache + UPGRADE-INSECURE-REQUESTS: 1 + USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 + ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + ACCEPT-ENCODING: gzip, deflate + ACCEPT-LANGUAGE: en-US,en;q=0.9 +2024-05-02 08:55:08,086:INFO:192.168.137.1 - - [02/May/2024:08:55:08] "GET /?user_input=aa HTTP/1.1" 500 1428 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:55:08,240:INFO:192.168.137.1 - - [02/May/2024:08:55:08] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:55:37,692:ERROR:[02/May/2024:08:55:37] HTTP +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 799, in __set__ + raise ValueError(self.unicode_err) +ValueError: Page handlers MUST return bytes. Use tools.encode if you wish to return unicode. +2024-05-02 08:55:37,693:INFO:[02/May/2024:08:55:37] HTTP +Request Headers: + Remote-Addr: 192.168.137.1 + HOST: 192.168.137.182:8080 + CONNECTION: keep-alive + PRAGMA: no-cache + CACHE-CONTROL: no-cache + UPGRADE-INSECURE-REQUESTS: 1 + USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 + ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + ACCEPT-ENCODING: gzip, deflate + ACCEPT-LANGUAGE: en-US,en;q=0.9 +2024-05-02 08:55:37,694:INFO:192.168.137.1 - - [02/May/2024:08:55:37] "GET /?user_input=aa HTTP/1.1" 500 1428 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:55:37,875:INFO:192.168.137.1 - - [02/May/2024:08:55:37] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.137.182:8080/?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 08:56:55,708:INFO:[02/May/2024:08:56:55] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 08:56:55,708:INFO:[02/May/2024:08:56:55] ENGINE Bus STOPPING +2024-05-02 08:56:55,883:INFO:[02/May/2024:08:56:55] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 08:56:55,883:INFO:[02/May/2024:08:56:55] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 08:56:55,884:INFO:[02/May/2024:08:56:55] ENGINE Bus STOPPED +2024-05-02 08:56:55,884:INFO:[02/May/2024:08:56:55] ENGINE Bus EXITING +2024-05-02 08:56:55,884:INFO:[02/May/2024:08:56:55] ENGINE Bus EXITED +2024-05-02 08:56:55,884:INFO:[02/May/2024:08:56:55] ENGINE Waiting for child threads to terminate... +2024-05-02 08:57:27,514:INFO:[02/May/2024:08:57:27] ENGINE Bus STARTING +2024-05-02 08:57:27,516:INFO:[02/May/2024:08:57:27] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 08:57:27,742:INFO:[02/May/2024:08:57:27] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 08:57:27,742:INFO:[02/May/2024:08:57:27] ENGINE Bus STARTED +2024-05-02 08:57:38,301:ERROR:[02/May/2024:08:57:38] HTTP +Traceback (most recent call last): + File "C:\Program Files\Python312\Lib\inspect.py", line 1388, in getfullargspec + sig = _signature_from_callable(func, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Program Files\Python312\Lib\inspect.py", line 2484, in _signature_from_callable + raise TypeError('{!r} is not a callable object'.format(obj)) +TypeError: is not a callable object + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 58, in __call__ + test_callable_spec(self.callable, self.args, self.kwargs) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 89, in test_callable_spec + (args, varargs, varkw, defaults) = getargspec(callable) + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 210, in getargspec + return inspect.getfullargspec(callable)[:4] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Program Files\Python312\Lib\inspect.py", line 1398, in getfullargspec + raise TypeError('unsupported callable') from ex +TypeError: unsupported callable + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 638, in respond + self._do_respond(path_info) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cprequest.py", line 697, in _do_respond + response.body = self.handler() + ^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\encoding.py", line 223, in __call__ + self.body = self.oldhandler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\lib\jsontools.py", line 59, in json_handler + value = cherrypy.serving.request._json_inner_handler(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 62, in __call__ + raise x + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpdispatch.py", line 54, in __call__ + return self.callable(*self.args, **self.kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'ConversionController' object is not callable +2024-05-02 08:57:38,373:INFO:[02/May/2024:08:57:38] HTTP +Request Headers: + Remote-Addr: 192.168.137.1 + HOST: 192.168.137.182:8080 + CONNECTION: keep-alive + PRAGMA: no-cache + CACHE-CONTROL: no-cache + UPGRADE-INSECURE-REQUESTS: 1 + USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 + ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + ACCEPT-ENCODING: gzip, deflate + ACCEPT-LANGUAGE: en-US,en;q=0.9 +2024-05-02 08:57:38,374:INFO:192.168.137.1 - - [02/May/2024:08:57:38] "GET /convert?user_input=aa HTTP/1.1" 500 3552 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:09:55,267:INFO:[02/May/2024:09:09:55] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-02 09:09:55,268:INFO:[02/May/2024:09:09:55] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:09:55,268:INFO:[02/May/2024:09:09:55] ENGINE Bus STOPPING +2024-05-02 09:09:55,394:INFO:[02/May/2024:09:09:55] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:09:55,394:INFO:[02/May/2024:09:09:55] ENGINE Bus STOPPED +2024-05-02 09:09:55,394:INFO:[02/May/2024:09:09:55] ENGINE Bus EXITING +2024-05-02 09:09:55,395:INFO:[02/May/2024:09:09:55] ENGINE Bus EXITED +2024-05-02 09:09:55,495:INFO:[02/May/2024:09:09:55] ENGINE Waiting for child threads to terminate... +2024-05-02 09:09:55,496:INFO:[02/May/2024:09:09:55] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:09:56,041:INFO:[02/May/2024:09:09:56] ENGINE Bus STARTING +2024-05-02 09:09:56,042:INFO:[02/May/2024:09:09:56] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:09:56,261:INFO:[02/May/2024:09:09:56] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:09:56,262:INFO:[02/May/2024:09:09:56] ENGINE Bus STARTED +2024-05-02 09:17:07,023:INFO:[02/May/2024:09:17:07] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-02 09:17:07,023:INFO:[02/May/2024:09:17:07] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:17:07,023:INFO:[02/May/2024:09:17:07] ENGINE Bus STOPPING +2024-05-02 09:17:07,190:INFO:[02/May/2024:09:17:07] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:17:07,190:INFO:[02/May/2024:09:17:07] ENGINE Bus STOPPED +2024-05-02 09:17:07,190:INFO:[02/May/2024:09:17:07] ENGINE Bus EXITING +2024-05-02 09:17:07,190:INFO:[02/May/2024:09:17:07] ENGINE Bus EXITED +2024-05-02 09:17:07,230:INFO:[02/May/2024:09:17:07] ENGINE Waiting for child threads to terminate... +2024-05-02 09:17:07,230:INFO:[02/May/2024:09:17:07] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:17:08,008:INFO:[02/May/2024:09:17:08] ENGINE Bus STARTING +2024-05-02 09:17:08,009:INFO:[02/May/2024:09:17:08] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:17:08,215:INFO:[02/May/2024:09:17:08] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:17:08,216:INFO:[02/May/2024:09:17:08] ENGINE Bus STARTED +2024-05-02 09:22:51,550:INFO:[02/May/2024:09:22:51] ENGINE Bus STARTING +2024-05-02 09:22:51,551:INFO:[02/May/2024:09:22:51] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:22:51,578:INFO:[02/May/2024:09:22:51] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\utilis\database_operations.py changed. +2024-05-02 09:22:51,579:INFO:[02/May/2024:09:22:51] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:22:51,579:INFO:[02/May/2024:09:22:51] ENGINE Bus STOPPING +2024-05-02 09:22:51,737:INFO:[02/May/2024:09:22:51] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:22:51,737:INFO:[02/May/2024:09:22:51] ENGINE Bus STOPPED +2024-05-02 09:22:51,737:INFO:[02/May/2024:09:22:51] ENGINE Bus EXITING +2024-05-02 09:22:51,737:INFO:[02/May/2024:09:22:51] ENGINE Bus EXITED +2024-05-02 09:22:51,782:INFO:[02/May/2024:09:22:51] ENGINE Waiting for child threads to terminate... +2024-05-02 09:22:51,782:INFO:[02/May/2024:09:22:51] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:22:51,893:INFO:[02/May/2024:09:22:51] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:22:51,893:INFO:[02/May/2024:09:22:51] ENGINE Bus STARTED +2024-05-02 09:22:52,302:INFO:[02/May/2024:09:22:52] ENGINE Bus STARTING +2024-05-02 09:22:52,303:INFO:[02/May/2024:09:22:52] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:22:53,485:ERROR:[02/May/2024:09:22:53] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-02 09:22:53,486:ERROR:[02/May/2024:09:22:53] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE Bus STOPPING +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE Bus STOPPED +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE Bus EXITING +2024-05-02 09:22:53,486:INFO:[02/May/2024:09:22:53] ENGINE Bus EXITED +2024-05-02 09:23:01,404:INFO:127.0.0.1 - - [02/May/2024:09:23:01] "GET / HTTP/1.1" 404 1518 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:23:01,444:INFO:127.0.0.1 - - [02/May/2024:09:23:01] "GET /favicon.ico HTTP/1.1" 304 - "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:23:07,588:INFO:127.0.0.1 - - [02/May/2024:09:23:07] "GET /api/v1/contacts HTTP/1.1" 404 1548 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:23:11,801:INFO:127.0.0.1 - - [02/May/2024:09:23:11] "GET / HTTP/1.1" 404 1518 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:23:20,676:INFO:[02/May/2024:09:23:20] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 09:23:20,676:INFO:[02/May/2024:09:23:20] ENGINE Bus STOPPING +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE Bus STOPPED +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE Bus EXITING +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE Bus EXITED +2024-05-02 09:23:20,840:INFO:[02/May/2024:09:23:20] ENGINE Waiting for child threads to terminate... +2024-05-02 09:23:21,505:INFO:[02/May/2024:09:23:21] ENGINE Bus STARTING +2024-05-02 09:23:21,506:INFO:[02/May/2024:09:23:21] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:23:21,726:INFO:[02/May/2024:09:23:21] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:23:21,727:INFO:[02/May/2024:09:23:21] ENGINE Bus STARTED +2024-05-02 09:23:31,710:INFO:127.0.0.1 - - [02/May/2024:09:23:31] "GET /conversion HTTP/1.1" 404 1538 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:23:50,086:INFO:[02/May/2024:09:23:50] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 09:23:50,086:INFO:[02/May/2024:09:23:50] ENGINE Bus STOPPING +2024-05-02 09:23:50,268:INFO:[02/May/2024:09:23:50] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:23:50,268:INFO:[02/May/2024:09:23:50] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:23:50,269:INFO:[02/May/2024:09:23:50] ENGINE Bus STOPPED +2024-05-02 09:23:50,269:INFO:[02/May/2024:09:23:50] ENGINE Bus EXITING +2024-05-02 09:23:50,269:INFO:[02/May/2024:09:23:50] ENGINE Bus EXITED +2024-05-02 09:23:50,269:INFO:[02/May/2024:09:23:50] ENGINE Waiting for child threads to terminate... +2024-05-02 09:23:50,883:INFO:[02/May/2024:09:23:50] ENGINE Bus STARTING +2024-05-02 09:23:50,883:INFO:[02/May/2024:09:23:50] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:23:51,094:INFO:[02/May/2024:09:23:51] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:23:51,094:INFO:[02/May/2024:09:23:51] ENGINE Bus STARTED +2024-05-02 09:24:18,469:INFO:127.0.0.1 - - [02/May/2024:09:24:18] "GET /?user_input=aaa HTTP/1.1" 404 1518 "" "PostmanRuntime/7.37.3" +2024-05-02 09:24:47,145:INFO:[02/May/2024:09:24:47] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 09:24:47,145:INFO:[02/May/2024:09:24:47] ENGINE Bus STOPPING +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE Bus STOPPED +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE Bus EXITING +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE Bus EXITED +2024-05-02 09:24:47,282:INFO:[02/May/2024:09:24:47] ENGINE Waiting for child threads to terminate... +2024-05-02 09:24:47,973:INFO:[02/May/2024:09:24:47] ENGINE Bus STARTING +2024-05-02 09:24:47,973:INFO:[02/May/2024:09:24:47] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:24:48,181:INFO:[02/May/2024:09:24:48] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:24:48,181:INFO:[02/May/2024:09:24:48] ENGINE Bus STARTED +2024-05-02 09:25:01,448:INFO:127.0.0.1 - - [02/May/2024:09:25:01] "GET /?user_input=aaa HTTP/1.1" 404 1518 "" "PostmanRuntime/7.37.3" +2024-05-02 09:26:58,099:INFO:127.0.0.1 - - [02/May/2024:09:26:58] "GET /convert HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:26:59,989:INFO:127.0.0.1 - - [02/May/2024:09:26:59] "GET /convert HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:27:00,121:INFO:127.0.0.1 - - [02/May/2024:09:27:00] "GET /convert HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:27:00,234:INFO:127.0.0.1 - - [02/May/2024:09:27:00] "GET /convert HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:27:08,593:INFO:127.0.0.1 - - [02/May/2024:09:27:08] "GET /get_history HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:28:39,160:INFO:[02/May/2024:09:28:39] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-02 09:28:39,160:INFO:[02/May/2024:09:28:39] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:28:39,160:INFO:[02/May/2024:09:28:39] ENGINE Bus STOPPING +2024-05-02 09:28:39,325:INFO:[02/May/2024:09:28:39] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:28:39,325:INFO:[02/May/2024:09:28:39] ENGINE Bus STOPPED +2024-05-02 09:28:39,325:INFO:[02/May/2024:09:28:39] ENGINE Bus EXITING +2024-05-02 09:28:39,325:INFO:[02/May/2024:09:28:39] ENGINE Bus EXITED +2024-05-02 09:28:39,417:INFO:[02/May/2024:09:28:39] ENGINE Waiting for child threads to terminate... +2024-05-02 09:28:39,417:INFO:[02/May/2024:09:28:39] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:28:40,437:INFO:[02/May/2024:09:28:40] ENGINE Bus STARTING +2024-05-02 09:28:40,437:INFO:[02/May/2024:09:28:40] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:28:40,658:INFO:[02/May/2024:09:28:40] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:28:40,658:INFO:[02/May/2024:09:28:40] ENGINE Bus STARTED +2024-05-02 09:28:46,533:INFO:[02/May/2024:09:28:46] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\main_app.py changed. +2024-05-02 09:28:46,533:INFO:[02/May/2024:09:28:46] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:28:46,533:INFO:[02/May/2024:09:28:46] ENGINE Bus STOPPING +2024-05-02 09:28:46,686:INFO:[02/May/2024:09:28:46] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:28:46,686:INFO:[02/May/2024:09:28:46] ENGINE Bus STOPPED +2024-05-02 09:28:46,686:INFO:[02/May/2024:09:28:46] ENGINE Bus EXITING +2024-05-02 09:28:46,686:INFO:[02/May/2024:09:28:46] ENGINE Bus EXITED +2024-05-02 09:28:46,785:INFO:[02/May/2024:09:28:46] ENGINE Waiting for child threads to terminate... +2024-05-02 09:28:46,785:INFO:[02/May/2024:09:28:46] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:28:47,205:INFO:[02/May/2024:09:28:47] ENGINE Bus STARTING +2024-05-02 09:28:47,206:INFO:[02/May/2024:09:28:47] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:28:47,428:INFO:[02/May/2024:09:28:47] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:28:47,429:INFO:[02/May/2024:09:28:47] ENGINE Bus STARTED +2024-05-02 09:28:50,242:INFO:[02/May/2024:09:28:50] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\utilis\database_operations.py changed. +2024-05-02 09:28:50,243:INFO:[02/May/2024:09:28:50] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:28:50,243:INFO:[02/May/2024:09:28:50] ENGINE Bus STOPPING +2024-05-02 09:28:50,405:INFO:[02/May/2024:09:28:50] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:28:50,405:INFO:[02/May/2024:09:28:50] ENGINE Bus STOPPED +2024-05-02 09:28:50,405:INFO:[02/May/2024:09:28:50] ENGINE Bus EXITING +2024-05-02 09:28:50,405:INFO:[02/May/2024:09:28:50] ENGINE Bus EXITED +2024-05-02 09:28:50,441:INFO:[02/May/2024:09:28:50] ENGINE Waiting for child threads to terminate... +2024-05-02 09:28:50,441:INFO:[02/May/2024:09:28:50] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:28:51,004:INFO:[02/May/2024:09:28:51] ENGINE Bus STARTING +2024-05-02 09:28:51,005:INFO:[02/May/2024:09:28:51] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:28:51,248:INFO:[02/May/2024:09:28:51] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:28:51,248:INFO:[02/May/2024:09:28:51] ENGINE Bus STARTED +2024-05-02 09:29:53,912:INFO:[02/May/2024:09:29:53] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\controller\conversion_controller.py changed. +2024-05-02 09:29:53,912:INFO:[02/May/2024:09:29:53] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:29:53,912:INFO:[02/May/2024:09:29:53] ENGINE Bus STOPPING +2024-05-02 09:29:54,063:INFO:[02/May/2024:09:29:54] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:29:54,063:INFO:[02/May/2024:09:29:54] ENGINE Bus STOPPED +2024-05-02 09:29:54,063:INFO:[02/May/2024:09:29:54] ENGINE Bus EXITING +2024-05-02 09:29:54,063:INFO:[02/May/2024:09:29:54] ENGINE Bus EXITED +2024-05-02 09:29:54,068:INFO:[02/May/2024:09:29:54] ENGINE Waiting for child threads to terminate... +2024-05-02 09:29:54,068:INFO:[02/May/2024:09:29:54] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:29:54,586:INFO:[02/May/2024:09:29:54] ENGINE Bus STARTING +2024-05-02 09:29:54,587:INFO:[02/May/2024:09:29:54] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:29:54,802:INFO:[02/May/2024:09:29:54] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:29:54,802:INFO:[02/May/2024:09:29:54] ENGINE Bus STARTED +2024-05-02 09:30:14,216:INFO:[02/May/2024:09:30:14] ENGINE Bus STARTING +2024-05-02 09:30:14,217:INFO:[02/May/2024:09:30:14] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:30:15,372:ERROR:[02/May/2024:09:30:15] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-02 09:30:15,373:ERROR:[02/May/2024:09:30:15] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE Bus STOPPING +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE Bus STOPPED +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE Bus EXITING +2024-05-02 09:30:15,373:INFO:[02/May/2024:09:30:15] ENGINE Bus EXITED +2024-05-02 09:30:34,960:INFO:[02/May/2024:09:30:34] ENGINE Bus STARTING +2024-05-02 09:30:34,960:INFO:[02/May/2024:09:30:34] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:30:35,171:INFO:[02/May/2024:09:30:35] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:30:35,172:INFO:[02/May/2024:09:30:35] ENGINE Bus STARTED +2024-05-02 09:30:48,162:INFO:127.0.0.1 - - [02/May/2024:09:30:48] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:31:19,976:INFO:127.0.0.1 - - [02/May/2024:09:31:19] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:31:20,015:INFO:127.0.0.1 - - [02/May/2024:09:31:20] "GET /favicon.ico HTTP/1.1" 200 1406 "http://localhost:8080/convert?user_input=aa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" +2024-05-02 09:32:10,643:INFO:[02/May/2024:09:32:10] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 09:32:10,643:INFO:[02/May/2024:09:32:10] ENGINE Bus STOPPING +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE Bus STOPPED +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE Bus EXITING +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE Bus EXITED +2024-05-02 09:32:10,769:INFO:[02/May/2024:09:32:10] ENGINE Waiting for child threads to terminate... +2024-05-02 09:32:11,524:INFO:[02/May/2024:09:32:11] ENGINE Bus STARTING +2024-05-02 09:32:11,526:INFO:[02/May/2024:09:32:11] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:32:11,739:INFO:[02/May/2024:09:32:11] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:32:11,739:INFO:[02/May/2024:09:32:11] ENGINE Bus STARTED +2024-05-02 09:35:03,936:INFO:192.168.137.1 - - [02/May/2024:09:35:03] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:35:18,221:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,237:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=abbcc HTTP/1.1" 200 54 "" "python-requests/2.31.0" +2024-05-02 09:35:18,254:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=dz_a_aazzaaa HTTP/1.1" 200 59 "" "python-requests/2.31.0" +2024-05-02 09:35:18,270:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,281:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=abcdabcdab HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:35:18,295:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 09:35:18,305:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=zdaaaaaaaabaaaaaaaabaaaaaaaabbaa HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:35:18,319:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_ HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:35:18,332:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa HTTP/1.1" 200 55 "" "python-requests/2.31.0" +2024-05-02 09:35:18,346:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,357:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=_ad HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,368:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,379:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=_zzzb HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,392:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=__ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:35:18,405:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=+++ HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:35:18,420:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=%40%40%40 HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:35:18,438:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=1234 HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 09:35:18,451:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=aaa HTTP/1.1" 200 63 "" "python-requests/2.31.0" +2024-05-02 09:35:18,466:INFO:192.168.137.1 - - [02/May/2024:09:35:18] "GET /convert?user_input=ccc HTTP/1.1" 200 63 "" "python-requests/2.31.0" +2024-05-02 09:37:23,116:INFO:[02/May/2024:09:37:23] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:37:23,116:INFO:[02/May/2024:09:37:23] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:37:23,116:INFO:[02/May/2024:09:37:23] ENGINE Bus STOPPING +2024-05-02 09:37:23,274:INFO:[02/May/2024:09:37:23] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:37:23,274:INFO:[02/May/2024:09:37:23] ENGINE Bus STOPPED +2024-05-02 09:37:23,274:INFO:[02/May/2024:09:37:23] ENGINE Bus EXITING +2024-05-02 09:37:23,274:INFO:[02/May/2024:09:37:23] ENGINE Bus EXITED +2024-05-02 09:37:23,284:INFO:[02/May/2024:09:37:23] ENGINE Waiting for child threads to terminate... +2024-05-02 09:37:23,284:INFO:[02/May/2024:09:37:23] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:37:23,861:INFO:[02/May/2024:09:37:23] ENGINE Bus STARTING +2024-05-02 09:37:23,862:INFO:[02/May/2024:09:37:23] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:37:24,083:INFO:[02/May/2024:09:37:24] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:37:24,083:INFO:[02/May/2024:09:37:24] ENGINE Bus STARTED +2024-05-02 09:39:16,758:INFO:[02/May/2024:09:39:16] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:39:16,758:INFO:[02/May/2024:09:39:16] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:39:16,758:INFO:[02/May/2024:09:39:16] ENGINE Bus STOPPING +2024-05-02 09:39:16,897:INFO:[02/May/2024:09:39:16] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:39:16,897:INFO:[02/May/2024:09:39:16] ENGINE Bus STOPPED +2024-05-02 09:39:16,897:INFO:[02/May/2024:09:39:16] ENGINE Bus EXITING +2024-05-02 09:39:16,897:INFO:[02/May/2024:09:39:16] ENGINE Bus EXITED +2024-05-02 09:39:16,966:INFO:[02/May/2024:09:39:16] ENGINE Waiting for child threads to terminate... +2024-05-02 09:39:16,966:INFO:[02/May/2024:09:39:16] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:39:17,423:INFO:[02/May/2024:09:39:17] ENGINE Bus STARTING +2024-05-02 09:39:17,424:INFO:[02/May/2024:09:39:17] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:39:17,639:INFO:[02/May/2024:09:39:17] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:39:17,640:INFO:[02/May/2024:09:39:17] ENGINE Bus STARTED +2024-05-02 09:39:30,612:INFO:[02/May/2024:09:39:30] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:39:30,612:INFO:[02/May/2024:09:39:30] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:39:30,612:INFO:[02/May/2024:09:39:30] ENGINE Bus STOPPING +2024-05-02 09:39:30,775:INFO:[02/May/2024:09:39:30] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:39:30,775:INFO:[02/May/2024:09:39:30] ENGINE Bus STOPPED +2024-05-02 09:39:30,775:INFO:[02/May/2024:09:39:30] ENGINE Bus EXITING +2024-05-02 09:39:30,775:INFO:[02/May/2024:09:39:30] ENGINE Bus EXITED +2024-05-02 09:39:30,811:INFO:[02/May/2024:09:39:30] ENGINE Waiting for child threads to terminate... +2024-05-02 09:39:30,811:INFO:[02/May/2024:09:39:30] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:39:31,414:INFO:[02/May/2024:09:39:31] ENGINE Bus STARTING +2024-05-02 09:39:31,415:INFO:[02/May/2024:09:39:31] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:39:31,629:INFO:[02/May/2024:09:39:31] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:39:31,630:INFO:[02/May/2024:09:39:31] ENGINE Bus STARTED +2024-05-02 09:41:06,730:INFO:[02/May/2024:09:41:06] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:41:06,731:INFO:[02/May/2024:09:41:06] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:41:06,731:INFO:[02/May/2024:09:41:06] ENGINE Bus STOPPING +2024-05-02 09:41:06,915:INFO:[02/May/2024:09:41:06] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:41:06,915:INFO:[02/May/2024:09:41:06] ENGINE Bus STOPPED +2024-05-02 09:41:06,915:INFO:[02/May/2024:09:41:06] ENGINE Bus EXITING +2024-05-02 09:41:06,915:INFO:[02/May/2024:09:41:06] ENGINE Bus EXITED +2024-05-02 09:41:06,960:INFO:[02/May/2024:09:41:06] ENGINE Waiting for child threads to terminate... +2024-05-02 09:41:06,960:INFO:[02/May/2024:09:41:06] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:41:07,432:INFO:[02/May/2024:09:41:07] ENGINE Bus STARTING +2024-05-02 09:41:07,432:INFO:[02/May/2024:09:41:07] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:41:07,649:INFO:[02/May/2024:09:41:07] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:41:07,650:INFO:[02/May/2024:09:41:07] ENGINE Bus STARTED +2024-05-02 09:41:14,527:INFO:[02/May/2024:09:41:14] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:41:14,527:INFO:[02/May/2024:09:41:14] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:41:14,527:INFO:[02/May/2024:09:41:14] ENGINE Bus STOPPING +2024-05-02 09:41:14,709:INFO:[02/May/2024:09:41:14] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:41:14,709:INFO:[02/May/2024:09:41:14] ENGINE Bus STOPPED +2024-05-02 09:41:14,709:INFO:[02/May/2024:09:41:14] ENGINE Bus EXITING +2024-05-02 09:41:14,709:INFO:[02/May/2024:09:41:14] ENGINE Bus EXITED +2024-05-02 09:41:14,801:INFO:[02/May/2024:09:41:14] ENGINE Waiting for child threads to terminate... +2024-05-02 09:41:14,801:INFO:[02/May/2024:09:41:14] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:41:15,318:INFO:[02/May/2024:09:41:15] ENGINE Bus STARTING +2024-05-02 09:41:15,318:INFO:[02/May/2024:09:41:15] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:41:15,534:INFO:[02/May/2024:09:41:15] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:41:15,534:INFO:[02/May/2024:09:41:15] ENGINE Bus STARTED +2024-05-02 09:41:33,581:INFO:[02/May/2024:09:41:33] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:41:33,581:INFO:[02/May/2024:09:41:33] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:41:33,581:INFO:[02/May/2024:09:41:33] ENGINE Bus STOPPING +2024-05-02 09:41:33,758:INFO:[02/May/2024:09:41:33] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:41:33,758:INFO:[02/May/2024:09:41:33] ENGINE Bus STOPPED +2024-05-02 09:41:33,758:INFO:[02/May/2024:09:41:33] ENGINE Bus EXITING +2024-05-02 09:41:33,758:INFO:[02/May/2024:09:41:33] ENGINE Bus EXITED +2024-05-02 09:41:33,831:INFO:[02/May/2024:09:41:33] ENGINE Waiting for child threads to terminate... +2024-05-02 09:41:33,831:INFO:[02/May/2024:09:41:33] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:41:34,408:INFO:[02/May/2024:09:41:34] ENGINE Bus STARTING +2024-05-02 09:41:34,409:INFO:[02/May/2024:09:41:34] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:41:34,630:INFO:[02/May/2024:09:41:34] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:41:34,630:INFO:[02/May/2024:09:41:34] ENGINE Bus STARTED +2024-05-02 09:42:09,956:INFO:[02/May/2024:09:42:09] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:42:09,956:INFO:[02/May/2024:09:42:09] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:42:09,956:INFO:[02/May/2024:09:42:09] ENGINE Bus STOPPING +2024-05-02 09:42:10,081:INFO:[02/May/2024:09:42:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:42:10,081:INFO:[02/May/2024:09:42:10] ENGINE Bus STOPPED +2024-05-02 09:42:10,081:INFO:[02/May/2024:09:42:10] ENGINE Bus EXITING +2024-05-02 09:42:10,081:INFO:[02/May/2024:09:42:10] ENGINE Bus EXITED +2024-05-02 09:42:10,125:INFO:[02/May/2024:09:42:10] ENGINE Waiting for child threads to terminate... +2024-05-02 09:42:10,125:INFO:[02/May/2024:09:42:10] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:42:10,592:INFO:[02/May/2024:09:42:10] ENGINE Bus STARTING +2024-05-02 09:42:10,593:INFO:[02/May/2024:09:42:10] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:42:10,802:INFO:[02/May/2024:09:42:10] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:42:10,803:INFO:[02/May/2024:09:42:10] ENGINE Bus STARTED +2024-05-02 09:42:20,719:INFO:[02/May/2024:09:42:20] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:42:20,719:INFO:[02/May/2024:09:42:20] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:42:20,719:INFO:[02/May/2024:09:42:20] ENGINE Bus STOPPING +2024-05-02 09:42:20,856:INFO:[02/May/2024:09:42:20] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:42:20,856:INFO:[02/May/2024:09:42:20] ENGINE Bus STOPPED +2024-05-02 09:42:20,856:INFO:[02/May/2024:09:42:20] ENGINE Bus EXITING +2024-05-02 09:42:20,856:INFO:[02/May/2024:09:42:20] ENGINE Bus EXITED +2024-05-02 09:42:20,861:INFO:[02/May/2024:09:42:20] ENGINE Waiting for child threads to terminate... +2024-05-02 09:42:20,861:INFO:[02/May/2024:09:42:20] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:50:39,001:INFO:[02/May/2024:09:50:39] ENGINE Bus STARTING +2024-05-02 09:50:39,002:INFO:[02/May/2024:09:50:39] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:50:39,221:INFO:[02/May/2024:09:50:39] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:50:39,221:INFO:[02/May/2024:09:50:39] ENGINE Bus STARTED +2024-05-02 09:51:00,110:INFO:192.168.137.1 - - [02/May/2024:09:51:00] "GET /convert?input_str=aa HTTP/1.1" 404 2614 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:05,684:INFO:192.168.137.1 - - [02/May/2024:09:51:05] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:08,182:INFO:192.168.137.1 - - [02/May/2024:09:51:08] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:08,311:INFO:192.168.137.1 - - [02/May/2024:09:51:08] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:20,258:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,273:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=abbcc HTTP/1.1" 200 54 "" "python-requests/2.31.0" +2024-05-02 09:51:20,288:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=dz_a_aazzaaa HTTP/1.1" 200 59 "" "python-requests/2.31.0" +2024-05-02 09:51:20,326:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,339:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=abcdabcdab HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:51:20,364:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 09:51:20,376:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=zdaaaaaaaabaaaaaaaabaaaaaaaabbaa HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:51:20,388:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_ HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:51:20,399:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa HTTP/1.1" 200 55 "" "python-requests/2.31.0" +2024-05-02 09:51:20,413:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,423:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=_ad HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,434:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,443:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=_zzzb HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,451:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=__ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:51:20,463:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=+++ HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:51:20,474:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=%40%40%40 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:51:20,485:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=1234 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:51:20,495:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=aaa HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:51:20,508:INFO:192.168.137.1 - - [02/May/2024:09:51:20] "GET /convert?user_input=ccc HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:51:31,660:INFO:192.168.137.1 - - [02/May/2024:09:51:31] "GET /convert?user_input=@@@ HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:58,789:INFO:192.168.137.1 - - [02/May/2024:09:51:58] "GET /convert?user_input=@@@ HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:59,491:INFO:192.168.137.1 - - [02/May/2024:09:51:59] "GET /convert?user_input=@@@ HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:59,564:INFO:[02/May/2024:09:51:59] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 09:51:59,564:INFO:[02/May/2024:09:51:59] ENGINE Bus STOPPING +2024-05-02 09:51:59,842:INFO:192.168.137.1 - - [02/May/2024:09:51:59] "GET /convert?user_input=@@@ HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE Bus STOPPED +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE Bus EXITING +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE Bus EXITED +2024-05-02 09:51:59,954:INFO:[02/May/2024:09:51:59] ENGINE Waiting for child threads to terminate... +2024-05-02 09:52:00,495:INFO:[02/May/2024:09:52:00] ENGINE Bus STARTING +2024-05-02 09:52:00,496:INFO:[02/May/2024:09:52:00] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:52:00,722:INFO:[02/May/2024:09:52:00] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:52:00,722:INFO:[02/May/2024:09:52:00] ENGINE Bus STARTED +2024-05-02 09:52:00,836:INFO:192.168.137.1 - - [02/May/2024:09:52:00] "GET /convert?user_input=@@@ HTTP/1.1" 200 52 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:52:03,813:INFO:192.168.137.1 - - [02/May/2024:09:52:03] "GET /convert?user_input=@@@ HTTP/1.1" 200 52 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:52:40,977:INFO:[02/May/2024:09:52:40] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 09:52:40,977:INFO:[02/May/2024:09:52:40] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:52:40,977:INFO:[02/May/2024:09:52:40] ENGINE Bus STOPPING +2024-05-02 09:52:41,127:INFO:[02/May/2024:09:52:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 09:52:41,127:INFO:[02/May/2024:09:52:41] ENGINE Bus STOPPED +2024-05-02 09:52:41,127:INFO:[02/May/2024:09:52:41] ENGINE Bus EXITING +2024-05-02 09:52:41,128:INFO:[02/May/2024:09:52:41] ENGINE Bus EXITED +2024-05-02 09:52:41,152:INFO:[02/May/2024:09:52:41] ENGINE Waiting for child threads to terminate... +2024-05-02 09:52:41,152:INFO:[02/May/2024:09:52:41] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 09:52:41,601:INFO:[02/May/2024:09:52:41] ENGINE Bus STARTING +2024-05-02 09:52:41,602:INFO:[02/May/2024:09:52:41] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:52:41,862:INFO:[02/May/2024:09:52:41] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:52:41,863:INFO:[02/May/2024:09:52:41] ENGINE Bus STARTED +2024-05-02 09:58:33,991:INFO:[02/May/2024:09:58:33] ENGINE Bus STARTING +2024-05-02 09:58:33,992:INFO:[02/May/2024:09:58:33] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:58:35,099:ERROR:[02/May/2024:09:58:35] ENGINE Error in 'start' listener > +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 122, in free + Checker(timeout=0.1).assert_free(host, port) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 71, in assert_free + list(itertools.starmap(self._connect, info)) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 87, in _connect + raise PortNotFree(tmpl.format(**locals())) +portend.PortNotFree: Port 8080 is in use on 127.0.0.1. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 230, in publish + output.append(listener(*args, **kwargs)) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\_cpserver.py", line 180, in start + super(Server, self).start() + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\servers.py", line 177, in start + portend.free(*self.bind_addr, timeout=Timeouts.free) + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\portend.py", line 126, in free + raise Timeout("Port {port} not free on {host}.".format(**locals())) +portend.Timeout: Port 8080 not free on 0.0.0.0. + +2024-05-02 09:58:35,099:ERROR:[02/May/2024:09:58:35] ENGINE Shutting down due to error in start listener: +Traceback (most recent call last): + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 268, in start + self.publish('start') + File "C:\Users\71524\AppData\Roaming\Python\Python312\site-packages\cherrypy\process\wspbus.py", line 248, in publish + raise exc +cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0.') + +2024-05-02 09:58:35,099:INFO:[02/May/2024:09:58:35] ENGINE Bus STOPPING +2024-05-02 09:58:35,099:INFO:[02/May/2024:09:58:35] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down +2024-05-02 09:58:35,100:INFO:[02/May/2024:09:58:35] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 09:58:35,101:INFO:[02/May/2024:09:58:35] ENGINE Bus STOPPED +2024-05-02 09:58:35,101:INFO:[02/May/2024:09:58:35] ENGINE Bus EXITING +2024-05-02 09:58:35,101:INFO:[02/May/2024:09:58:35] ENGINE Bus EXITED +2024-05-02 09:58:41,026:INFO:192.168.137.1 - - [02/May/2024:09:58:41] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:47,716:INFO:[02/May/2024:09:58:47] ENGINE Bus STARTING +2024-05-02 09:58:47,717:INFO:[02/May/2024:09:58:47] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 09:58:47,938:INFO:[02/May/2024:09:58:47] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 09:58:47,938:INFO:[02/May/2024:09:58:47] ENGINE Bus STARTED +2024-05-02 09:58:52,611:INFO:192.168.137.1 - - [02/May/2024:09:58:52] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:52,748:INFO:192.168.137.1 - - [02/May/2024:09:58:52] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:52,906:INFO:192.168.137.1 - - [02/May/2024:09:58:52] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:53,049:INFO:192.168.137.1 - - [02/May/2024:09:58:53] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:53,200:INFO:192.168.137.1 - - [02/May/2024:09:58:53] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:58:53,309:INFO:192.168.137.1 - - [02/May/2024:09:58:53] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:59:12,650:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,665:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=abbcc HTTP/1.1" 200 54 "" "python-requests/2.31.0" +2024-05-02 09:59:12,678:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=dz_a_aazzaaa HTTP/1.1" 200 59 "" "python-requests/2.31.0" +2024-05-02 09:59:12,690:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,703:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=abcdabcdab HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:59:12,715:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 09:59:12,729:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=zdaaaaaaaabaaaaaaaabaaaaaaaabbaa HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:59:12,740:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_ HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 09:59:12,750:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa HTTP/1.1" 200 55 "" "python-requests/2.31.0" +2024-05-02 09:59:12,759:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,772:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=_ad HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,785:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,797:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=_zzzb HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,808:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=__ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 09:59:12,820:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=+++ HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 09:59:12,833:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=%40%40%40 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:59:12,845:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=1234 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:59:12,856:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=aaa HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:59:12,867:INFO:192.168.137.1 - - [02/May/2024:09:59:12] "GET /convert?user_input=ccc HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 09:59:21,484:INFO:192.168.137.1 - - [02/May/2024:09:59:21] "GET /convert?user_input= HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:59:29,819:INFO:192.168.137.1 - - [02/May/2024:09:59:29] "GET /convert?user_input=None HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:59:32,627:INFO:192.168.137.1 - - [02/May/2024:09:59:32] "GET /convert?user_input= HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 09:59:41,380:INFO:192.168.137.1 - - [02/May/2024:09:59:41] "GET /convert HTTP/1.1" 200 75 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:00:08,612:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,625:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=abbcc HTTP/1.1" 200 54 "" "python-requests/2.31.0" +2024-05-02 10:00:08,635:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=dz_a_aazzaaa HTTP/1.1" 200 59 "" "python-requests/2.31.0" +2024-05-02 10:00:08,646:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,656:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=abcdabcdab HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 10:00:08,667:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 10:00:08,690:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=zdaaaaaaaabaaaaaaaabaaaaaaaabbaa HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 10:00:08,702:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_ HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 10:00:08,712:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa HTTP/1.1" 200 55 "" "python-requests/2.31.0" +2024-05-02 10:00:08,721:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,732:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=_ad HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,743:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,756:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=_zzzb HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,767:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=__ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:00:08,779:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=+++ HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 10:00:08,789:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=%40%40%40 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:00:08,798:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=1234 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:00:08,808:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=aaa HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:00:08,819:INFO:192.168.137.1 - - [02/May/2024:10:00:08] "GET /convert?user_input=ccc HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:00:22,850:INFO:192.168.137.1 - - [02/May/2024:10:00:22] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:00:24,328:INFO:192.168.137.1 - - [02/May/2024:10:00:24] "GET /convert?user_input= HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:00:36,310:INFO:192.168.137.1 - - [02/May/2024:10:00:36] "GET /convert?user_input=%20%20%20 HTTP/1.1" 200 57 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:01:01,421:INFO:192.168.137.1 - - [02/May/2024:10:01:01] "GET /convert?user_input=+++ HTTP/1.1" 200 57 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:01:48,686:INFO:192.168.137.1 - - [02/May/2024:10:01:48] "GET /convert?user_input= HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:02:17,187:INFO:[02/May/2024:10:02:17] ENGINE Restarting because C:\Users\71524\PackageMeasurementConversionAPI\services\conversion_service.py changed. +2024-05-02 10:02:17,187:INFO:[02/May/2024:10:02:17] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 10:02:17,187:INFO:[02/May/2024:10:02:17] ENGINE Bus STOPPING +2024-05-02 10:02:17,319:INFO:[02/May/2024:10:02:17] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 10:02:17,319:INFO:[02/May/2024:10:02:17] ENGINE Bus STOPPED +2024-05-02 10:02:17,319:INFO:[02/May/2024:10:02:17] ENGINE Bus EXITING +2024-05-02 10:02:17,319:INFO:[02/May/2024:10:02:17] ENGINE Bus EXITED +2024-05-02 10:02:17,396:INFO:[02/May/2024:10:02:17] ENGINE Waiting for child threads to terminate... +2024-05-02 10:02:17,396:INFO:[02/May/2024:10:02:17] ENGINE Re-spawning C:\Program Files\Python312\python.exe C:\Users\71524\PackageMeasurementConversionAPI\main_app.py +2024-05-02 10:06:04,165:INFO:[02/May/2024:10:06:04] ENGINE Bus STARTING +2024-05-02 10:06:04,165:INFO:[02/May/2024:10:06:04] ENGINE Started monitor thread 'Autoreloader'. +2024-05-02 10:06:04,387:INFO:[02/May/2024:10:06:04] ENGINE Serving on http://0.0.0.0:8080 +2024-05-02 10:06:04,388:INFO:[02/May/2024:10:06:04] ENGINE Bus STARTED +2024-05-02 10:06:56,805:INFO:192.168.137.1 - - [02/May/2024:10:06:56] "GET /convert?user_input= HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:07:01,812:INFO:192.168.137.1 - - [02/May/2024:10:07:01] "GET /convert?user_input=+++ HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:07:07,243:INFO:192.168.137.1 - - [02/May/2024:10:07:07] "GET /convert?user_input=%20%20%20 HTTP/1.1" 200 50 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" +2024-05-02 10:07:21,995:INFO:192.168.137.1 - - [02/May/2024:10:07:21] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,029:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=abbcc HTTP/1.1" 200 54 "" "python-requests/2.31.0" +2024-05-02 10:07:22,055:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=dz_a_aazzaaa HTTP/1.1" 200 59 "" "python-requests/2.31.0" +2024-05-02 10:07:22,079:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,097:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=abcdabcdab HTTP/1.1" 200 57 "" "python-requests/2.31.0" +2024-05-02 10:07:22,114:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=abcdabcdab_ HTTP/1.1" 200 60 "" "python-requests/2.31.0" +2024-05-02 10:07:22,129:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=zdaaaaaaaabaaaaaaaabaaaaaaaabbaa HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 10:07:22,144:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=zza_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_a_ HTTP/1.1" 200 52 "" "python-requests/2.31.0" +2024-05-02 10:07:22,162:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=za_a_a_a_a_a_a_a_a_a_a_a_a_azaaa HTTP/1.1" 200 55 "" "python-requests/2.31.0" +2024-05-02 10:07:22,179:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,192:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=_ad HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,226:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=a_ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,240:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=_zzzb HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,258:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=__ HTTP/1.1" 200 51 "" "python-requests/2.31.0" +2024-05-02 10:07:22,284:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=+++ HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:07:22,299:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=%40%40%40 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:07:22,313:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=1234 HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:07:22,326:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=aaa HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:07:22,349:INFO:192.168.137.1 - - [02/May/2024:10:07:22] "GET /convert?user_input=ccc HTTP/1.1" 200 50 "" "python-requests/2.31.0" +2024-05-02 10:07:30,854:INFO:[02/May/2024:10:07:30] ENGINE Keyboard Interrupt: shutting down bus +2024-05-02 10:07:30,854:INFO:[02/May/2024:10:07:30] ENGINE Bus STOPPING +2024-05-02 10:07:31,020:INFO:[02/May/2024:10:07:31] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-02 10:07:31,020:INFO:[02/May/2024:10:07:31] ENGINE Stopped thread 'Autoreloader'. +2024-05-02 10:07:31,020:INFO:[02/May/2024:10:07:31] ENGINE Bus STOPPED +2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Bus EXITING +2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Bus EXITED +2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Waiting for child threads to terminate... diff --git a/measurements.db b/measurements.db index ffdb328e305f6b6abfbe34996f645e40d9dca076..4b090a929861a3df2e6422076793339e23356300 100644 GIT binary patch literal 20480 zcmeHOZ)_7~7{6<;*Y(fcbyv1g%H+0gFkm3v#y~~bm=!1cN4F`nV7awr4z~{4Zo&k~ zt0s!Un4lk2)bIh6#3;mXCK6QCZzd+hKOr&31QQ~}=od^d{(0VB+qJ#-wr<%c^WNI6 z{oQlVz3=aS&+UEgeV_haU8AX(vVS5muBMb`#>KEK)21j4!<>V+1>V_>g%4cz3;f03 z=i1IO>*F5_U}X|dG2(UjMK{U-Wq>k38K4YM1}FoR0m=YnfHFWCpbVrL=ri$EYuB1j9_J2V-KM~c6iJA#4sfq*j5zP&4;6xlY!)$v#(9J%^g4{NRR`Pk=< zq66@Rhg2t`N6|(WuhdGZ5Gj2r7NS&hGZ$kg_u{q_htX^mg`u zv+h98K%>FIlgU^jJQ_bZnNkJR-|Ila3YqR9Gl%ZnNm}e$yxoy5{ZdKcs!O& zsw1(qRyhXYry&)lKRO*)eQiWs|e-ghIKNL@jDKRSciW|jB(Ii|KJ{Qgi zCxyd8ROl172o1s#fpOk){^0z=dC~cn^F?RMxzE|<-0ZA#x*WG1-#9*Tyy-|e+U>XP zpV~jLzixltK5iefZ?*gEob4CeSGJFA@7P|lP1*L?T5Yv9rtDhTdu4mdR+hP~|5$&u zUbSAfp0%E`9=DELL)K2~CTqRb&Hu~ay@E7>g{0n@N5A!>DKku;oY5CT2!E)5% z=ly*i z8?oRW8>`V7({jY{jD*n{tmQb*bbGzRv>G=2nZ|u=0akOAbUwo~$132c*$y*y7!EbH zW;yd8g9cz%Q8-I_8`ggSDAe4NJ*4g^&-m)$A`M5P+8Z1;Dx1=;9AV1SJW~Urn6b(l zW&Oz0dgkhm@JzkWD@3Pp^Ht~|oVsaqqq4C%um4LA!?o~W-@~8@ICri)@>6;NNmE5K zb5CkA>6wVfa*B{rMOJcBlTCr_5*mhEmFUpb+l%%#{L$#@TwaNPkSeSr4PQdmO zussAUM8F;+U_*Kp%DeTL>ruc2uK;Sz+~r-5=#W7jGN42HH3UK?>nEro5HJ~}d>4cZ zoD1KhvqpWzjy%197=%iX*3W{Qb2m9ux-yjH-EiGI!Lu$@9@d9S=Ym4zp~VZ89rF*B z2TKZ-z?`A-fS$Lyj*>!UyJ4ub6Xe-Oz_t;vt$M8bez=aS(u0D|_>?*ZW7G8LG9#(# zE!u9-9dY-4AVT;TmL4c%hAjD`mU}h%;k$S7faV@;7h$X;Z`PVwpv+BVWwvH|l&{Q< z;8~~47QHf?7o^Ol#Z#t#{>t1?k}~g}Q<>}ayw$BMNtum?%3P~gm%N66ttMa%1Z))n zTS>s`30NHg^AWIG0#-x76auz_fZavFstMR~0_G)P%LtfLU$ZigA`Wsqta?t_fWXkR7dU8GJ|Lh41rT{!J3Xq5|c zu0o_1vaPv#SB;Y|Oj+^0A97j_NqBCam40L3MK{U-Wq>k38K4YM1}FoR0m=YnfHFWC zpbSt3{ud0mShLTRx3+;fi}U|iV1irvS-K>>Pv`&X{D09SemegTPtIVQSqMPq|1*z5 zWjgh~GvcT?C~gzi zh_djva6`B%ToTTMDcvXolmW^BWq>k38K4YM1}FoR0m=YnU~w3b5!5~COMId50fR6V zHB)Sfpz?uG;tS6{uxWm|rHr8X0fV?yC-*23WvU+vigXZ^KM-qsvn3FDkDJ^GY9RD= zItZ#DifeljR6#7DxEDd8#9~$VA}Fw!Z+S0*0*n&sdl6J&%u(Qra2W=aG!;CqLr{HD dLWwVef((NiUj)S%`YLf;hoQULxDKNT{0}HnBxwKu delta 98 zcmZozz}S#5L7G*Jfq{W}qJll6*v5nf{CvDXt|;#l2L6Zqd-+#S<`YoaSh$IoOGcE9 zK~PfQx8Tj9C7F4*)KQVwqke`uRnK3y(uPn8wI5R)5SQG%Z C8yThm diff --git a/services/conversion_service.py b/services/conversion_service.py index 268182e..4ac7c53 100644 --- a/services/conversion_service.py +++ b/services/conversion_service.py @@ -50,11 +50,16 @@ def converted_string(self, input_string): :param input_string: A sequence of characters :return: A result list containing the converted values """ + input_string = input_string.strip() + allowed_characters = set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ ") + for char in input_string: + if char not in allowed_characters: + return [] char_list = [self.char_value(input_string[i]) for i in range(len(input_string))] result_list = [] merged_list = self.get_merged_list(char_list) if merged_list == 'Invalid': - return "Invalid input" + return [] else: while merged_list: counter = merged_list[0] @@ -62,7 +67,7 @@ def converted_string(self, input_string): result_list.append(0) merged_list = [] elif counter >= len(merged_list) or len(merged_list) < 1: - return "Invalid input" + return [] else: merged_list.pop(0) result_list.append(sum(merged_list[0:counter])) @@ -71,10 +76,10 @@ def converted_string(self, input_string): if result_list and len(merged_list) == 0: return result_list else: - return f"Invalid input" + return [] # # Check that the conversion is correct # user_string = Conversion() -# print(user_string.converted_string("abbcc")) +# print(user_string.converted_string(" ")) diff --git a/test_conversion.py b/test_conversion.py index d3b1b93..ea9b72f 100644 --- a/test_conversion.py +++ b/test_conversion.py @@ -58,19 +58,19 @@ def test_string_starting_all_underscore(self): def test_invalid_string(self): user_string = Conversion() - self.assertEqual(user_string.converted_string('aaa'), "Invalid input") + self.assertEqual(user_string.converted_string('aaa'), []) def test_empty_string(self): user_string = Conversion() - self.assertEqual(user_string.converted_string(''), "Invalid input") + self.assertEqual(user_string.converted_string(''), []) def test_single_letter_string(self): user_string = Conversion() - self.assertEqual(user_string.converted_string('a'), "Invalid input") + self.assertEqual(user_string.converted_string('a'), []) def test_invalid_length_string(self): user_string = Conversion() - self.assertEqual(user_string.converted_string('abccc'), "Invalid input") + self.assertEqual(user_string.converted_string(' '), []) if __name__ == "__main__": From 0f16531a9e83c7e41c8605115c9a84d2fbe1f9f0 Mon Sep 17 00:00:00 2001 From: Sara Yasser Amur Al Shukaili <71524@omantel.om> Date: Fri, 3 May 2024 13:07:44 +0400 Subject: [PATCH 5/5] Edited the readme file --- READMe.md | 7 +++---- error_logs.log | 15 +++++++++++++++ measurements.db | Bin 20480 -> 20480 bytes 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/READMe.md b/READMe.md index f5af216..29a4d7b 100644 --- a/READMe.md +++ b/READMe.md @@ -22,19 +22,18 @@ This Measurement Conversion application enables users to input a string of chara ## Usage - Get a specific string: - Default: http://localhost:8080/?user_input= - Specific port: http://localhost:/?user_input= + Default: http://localhost:8080/convert?user_input= + Specific port: http://localhost:/convert?user_input= - Get history of all conversions: Default: http://localhost:8080/get_history - Specific port: http://localhost:/get_history ### Running the Program - **Script**: - Default: ```python main.py``` + Default: ```python main_app.py``` Specific port: ```python main_app.py ``` - **Access URL**: diff --git a/error_logs.log b/error_logs.log index f123d7d..3b7f05c 100644 --- a/error_logs.log +++ b/error_logs.log @@ -1697,3 +1697,18 @@ cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 0.0.0.0. 2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Bus EXITING 2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Bus EXITED 2024-05-02 10:07:31,021:INFO:[02/May/2024:10:07:31] ENGINE Waiting for child threads to terminate... +2024-05-03 13:04:50,677:INFO:[03/May/2024:13:04:50] ENGINE Bus STARTING +2024-05-03 13:04:50,679:INFO:[03/May/2024:13:04:50] ENGINE Started monitor thread 'Autoreloader'. +2024-05-03 13:04:51,042:INFO:[03/May/2024:13:04:51] ENGINE Serving on http://0.0.0.0:8080 +2024-05-03 13:04:51,043:INFO:[03/May/2024:13:04:51] ENGINE Bus STARTED +2024-05-03 13:04:55,958:INFO:127.0.0.1 - - [03/May/2024:13:04:55] "GET / HTTP/1.1" 404 1518 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58" +2024-05-03 13:04:56,264:INFO:127.0.0.1 - - [03/May/2024:13:04:56] "GET /favicon.ico HTTP/1.1" 304 - "http://localhost:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58" +2024-05-03 13:05:20,364:INFO:127.0.0.1 - - [03/May/2024:13:05:20] "GET /convert?user_input=aa HTTP/1.1" 200 51 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58" +2024-05-03 13:05:27,478:INFO:[03/May/2024:13:05:27] ENGINE Keyboard Interrupt: shutting down bus +2024-05-03 13:05:27,478:INFO:[03/May/2024:13:05:27] ENGINE Bus STOPPING +2024-05-03 13:05:30,739:INFO:[03/May/2024:13:05:30] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) shut down +2024-05-03 13:05:30,739:INFO:[03/May/2024:13:05:30] ENGINE Stopped thread 'Autoreloader'. +2024-05-03 13:05:30,739:INFO:[03/May/2024:13:05:30] ENGINE Bus STOPPED +2024-05-03 13:05:30,739:INFO:[03/May/2024:13:05:30] ENGINE Bus EXITING +2024-05-03 13:05:30,739:INFO:[03/May/2024:13:05:30] ENGINE Bus EXITED +2024-05-03 13:05:30,740:INFO:[03/May/2024:13:05:30] ENGINE Waiting for child threads to terminate... diff --git a/measurements.db b/measurements.db index 4b090a929861a3df2e6422076793339e23356300..9d2ff563e21cc5ebea9289039d896231e3c160bf 100644 GIT binary patch delta 53 zcmV-50LuS>paFoO0gxL3rjZ;&0j9BFpDzKWvM>Y?0~QT_lLtU60u6q#aY_vX5`iU? LVHOj!luc{`%WV)a delta 42 zcmV+_0M-A1paFoO0gxL3rI8#%0j05EpDzKVvM>Y?0~HOElLtU6v2kGyvy)A20yJR_ A^8f$<