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/READMe.md b/READMe.md new file mode 100644 index 0000000..29a4d7b --- /dev/null +++ b/READMe.md @@ -0,0 +1,55 @@ +# 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/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_app.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/conversion_controller.py b/controller/conversion_controller.py new file mode 100644 index 0000000..8bb2234 --- /dev/null +++ b/controller/conversion_controller.py @@ -0,0 +1,95 @@ +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: + + 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.expose + @cherrypy.tools.json_out() + 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 + :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 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..3b7f05c --- /dev/null +++ b/error_logs.log @@ -0,0 +1,1714 @@ +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... +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... +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... +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/main_app.py b/main_app.py new file mode 100644 index 0000000..5446524 --- /dev/null +++ b/main_app.py @@ -0,0 +1,29 @@ +import cherrypy +import sys +import logging + +from controller.conversion_controller import ConversionController + +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(ConversionController(), '/') + 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 0000000..9d2ff56 Binary files /dev/null and b/measurements.db differ diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..e69de29 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/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/services/__init__.py b/services/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/services/conversion_service.py b/services/conversion_service.py new file mode 100644 index 0000000..4ac7c53 --- /dev/null +++ b/services/conversion_service.py @@ -0,0 +1,85 @@ + +class Conversion: + + def letter_value(self, letter: str): + """ + A function to return the value associated with each letter + :param letter: A single letter + :return: An integer value of the inputted letter + """ + value = ord(letter) - ord('a') + 1 + # print(f"The letter '{letter}' value is: {value}") # log statement to show the state of program + return value + + def char_value(self, input_list): + """ + A function that receives a list of letters/underscores and returns the integer values associated + :param input_list: A list of alphabetic characters and/or underscores + :return: A single integer value of each character + """ + for char in input_list: + if char == '_': + # print(f"The _ value is: 0") # log statement to show the state of program + return 0 + else: + return self.letter_value(char) + + def get_merged_list(self, input_string): + """ + A function to merge the value of z (26) with the next values + :param input_string: A string given by the user + :return: A merged list containing numeric values + """ + merged_list = [] + merged_value = 0 + if len(input_string) > 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 + """ + 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 [] + 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 [] + 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 [] + +# # Check that the conversion is correct +# user_string = Conversion() +# print(user_string.converted_string(" ")) + + diff --git a/test_conversion.py b/test_conversion.py new file mode 100644 index 0000000..ea9b72f --- /dev/null +++ b/test_conversion.py @@ -0,0 +1,77 @@ +import unittest + +from services.conversion_service 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'), []) + + def test_empty_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string(''), []) + + def test_single_letter_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string('a'), []) + + def test_invalid_length_string(self): + user_string = Conversion() + self.assertEqual(user_string.converted_string(' '), []) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/utilis/__init__.py b/utilis/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utilis/database_operations.py b/utilis/database_operations.py new file mode 100644 index 0000000..f87352e --- /dev/null +++ b/utilis/database_operations.py @@ -0,0 +1,47 @@ +import cherrypy +from models.database_initializer import init_db +from models.sequence_output import SequenceOutput + + +class 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 + + def save_to_db(self, m: SequenceOutput, converted_result): + """ + A function to save conversion data to the database + :param m: User sequence object containing user_input, converted_result, status, error_message + :param converted_result: Converted result string or list + """ + 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 (?, ?, ?, ?)''', + (m.user_input, m.converted_result, m.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