IvanGlinkin / CCTV

Close-Circuit Telegram Vision revolutionizes location tracking with its open-source design and Telegram API integration. Offering precise tracking within 50-100 meters, users can monitor others in real-time for logistics or safety, redefining how we navigate our surroundings
GNU General Public License v3.0
2.37k stars 327 forks source link

Code refactoring #36

Closed paracosm17 closed 4 months ago

paracosm17 commented 4 months ago

Just refactoring the code. The changes almost did not change the behavior of the program

The purpose of the fixes is to standardize the code to pep8, fix codestyle and identations, improve the performance and readability of the code

  1. Fix comments, empty strings, imports. Add ".idea" to .gitignore
  2. Fix "if" expressions. Fix lantitude, longitude types in "coordinates_overage" (from int to float). Remove timestamp from coordinates_overage (line 132 in original start.py), because redefined without timestamp in line 202, and so, timestamp in coordinates_overage is not used. Added better exception handling when opening a generated html file in the browser
  3. Code refactoring in functions.py. Added better get_location_details. The function "pring_city_by_geo" has been renamed to "print_city_by_geo". remove lon_rad from calculate_coordinates because not used. Change R to r. Correction of minor defects.
ask0n commented 4 months ago

Hi @paracosm17 to keep code standard across future changes we need to have pipeline with a linter, could you please add it as a part of this PR? Ruff would be a preferred one.

paracosm17 commented 4 months ago

Hi @paracosm17 to keep code standard across future changes we need to have pipeline with a linter, could you please add it as a part of this PR? Ruff would be a preferred one.

Hello, I'll add It today