use installable shared lib for shared code
This commit is contained in:
parent
37bffd5ce8
commit
73174858d6
0
components/__init__.py
Normal file
0
components/__init__.py
Normal file
@ -1,7 +1,7 @@
|
|||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
from flask_redis import Redis
|
from flask_redis import Redis
|
||||||
from shared.message_broker_wrapper import MBWrapper
|
from dse_shared_libs.message_broker_wrapper import MBWrapper
|
||||||
|
|
||||||
|
|
||||||
class EventLogger:
|
class EventLogger:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
from event_store.event_logger import EventLogger
|
from event_logger import EventLogger
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_redis import Redis
|
from flask_redis import Redis
|
||||||
|
|
||||||
|
|||||||
@ -6,10 +6,9 @@ from datetime import datetime
|
|||||||
from circuitbreaker import circuit
|
from circuitbreaker import circuit
|
||||||
|
|
||||||
# Default switching time in seconds
|
# Default switching time in seconds
|
||||||
from shared import traffic_light_color
|
from dse_shared_libs.traffic_light_color import TrafficLightColor
|
||||||
from shared.traffic_light_color import TrafficLightColor
|
from dse_shared_libs.message_broker_wrapper import MBWrapper
|
||||||
from shared.message_broker_wrapper import MBWrapper
|
from dse_shared_libs.traffic_light_state import TrafficLightState
|
||||||
from shared.traffic_light_state import TrafficLightState
|
|
||||||
|
|
||||||
SWITCHING_TIME = 500
|
SWITCHING_TIME = 500
|
||||||
# Scale speed of switching by factor x
|
# Scale speed of switching by factor x
|
||||||
|
|||||||
@ -7,12 +7,12 @@ from typing import Union
|
|||||||
import geopy
|
import geopy
|
||||||
import geopy.distance
|
import geopy.distance
|
||||||
from circuitbreaker import circuit
|
from circuitbreaker import circuit
|
||||||
from shared.daf import DAF
|
from dse_shared_libs.daf import DAF
|
||||||
|
|
||||||
from shared.message_broker_wrapper import MBWrapper
|
from dse_shared_libs.message_broker_wrapper import MBWrapper
|
||||||
|
|
||||||
# Lat, Long
|
# Lat, Long
|
||||||
from shared.target_velocity import TargetVelocity
|
from dse_shared_libs.target_velocity import TargetVelocity
|
||||||
|
|
||||||
STARTING_POINT = geopy.Point(48.853, 2.349)
|
STARTING_POINT = geopy.Point(48.853, 2.349)
|
||||||
# in km/h
|
# in km/h
|
||||||
|
|||||||
@ -3,13 +3,13 @@ import sys
|
|||||||
from random import randrange
|
from random import randrange
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
|
|
||||||
from shared import daf
|
from dse_shared_libs import daf
|
||||||
from shared.traffic_light_color import TrafficLightColor
|
from dse_shared_libs.traffic_light_color import TrafficLightColor
|
||||||
from shared.message_broker_wrapper import MBWrapper
|
from dse_shared_libs.message_broker_wrapper import MBWrapper
|
||||||
|
|
||||||
# necessary to unpickle daf object
|
# necessary to unpickle daf object
|
||||||
from shared.target_velocity import TargetVelocity
|
from dse_shared_libs.target_velocity import TargetVelocity
|
||||||
from shared.traffic_light_state import TrafficLightState
|
from dse_shared_libs.traffic_light_state import TrafficLightState
|
||||||
|
|
||||||
sys.modules['daf'] = daf
|
sys.modules['daf'] = daf
|
||||||
|
|
||||||
|
|||||||
5
components/shared/RADME.md
Normal file
5
components/shared/RADME.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Install shared libs via
|
||||||
|
* To have life changes: `python setup.py develop`
|
||||||
|
* To install properly: `python setup.py install`
|
||||||
|
|
||||||
|
Create installable package via `python setup.py sdist`
|
||||||
0
components/shared/__init__.py
Normal file
0
components/shared/__init__.py
Normal file
BIN
components/shared/dist/dse-shared-libs-1.tar.gz
vendored
Normal file
BIN
components/shared/dist/dse-shared-libs-1.tar.gz
vendored
Normal file
Binary file not shown.
BIN
components/shared/dist/dse_shared_libs-1-py3.8.egg
vendored
Normal file
BIN
components/shared/dist/dse_shared_libs-1-py3.8.egg
vendored
Normal file
Binary file not shown.
10
components/shared/dse_shared_libs.egg-info/PKG-INFO
Normal file
10
components/shared/dse_shared_libs.egg-info/PKG-INFO
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
Metadata-Version: 1.0
|
||||||
|
Name: dse-shared-libs
|
||||||
|
Version: 1
|
||||||
|
Summary: UNKNOWN
|
||||||
|
Home-page: UNKNOWN
|
||||||
|
Author: UNKNOWN
|
||||||
|
Author-email: UNKNOWN
|
||||||
|
License: BSD License
|
||||||
|
Description: UNKNOWN
|
||||||
|
Platform: UNKNOWN
|
||||||
11
components/shared/dse_shared_libs.egg-info/SOURCES.txt
Normal file
11
components/shared/dse_shared_libs.egg-info/SOURCES.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
setup.py
|
||||||
|
dse_shared_libs/__init__.py
|
||||||
|
dse_shared_libs/daf.py
|
||||||
|
dse_shared_libs/message_broker_wrapper.py
|
||||||
|
dse_shared_libs/target_velocity.py
|
||||||
|
dse_shared_libs/traffic_light_color.py
|
||||||
|
dse_shared_libs/traffic_light_state.py
|
||||||
|
dse_shared_libs.egg-info/PKG-INFO
|
||||||
|
dse_shared_libs.egg-info/SOURCES.txt
|
||||||
|
dse_shared_libs.egg-info/dependency_links.txt
|
||||||
|
dse_shared_libs.egg-info/top_level.txt
|
||||||
@ -0,0 +1 @@
|
|||||||
|
|
||||||
1
components/shared/dse_shared_libs.egg-info/top_level.txt
Normal file
1
components/shared/dse_shared_libs.egg-info/top_level.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
dse_shared_libs
|
||||||
0
components/shared/dse_shared_libs/__init__.py
Normal file
0
components/shared/dse_shared_libs/__init__.py
Normal file
@ -1,7 +1,7 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from shared.traffic_light_color import TrafficLightColor
|
from dse_shared_libs.traffic_light_color import TrafficLightColor
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
8
components/shared/setup.py
Normal file
8
components/shared/setup.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
setup(name='dse-shared-libs',
|
||||||
|
version=1,
|
||||||
|
packages=find_packages(),
|
||||||
|
include_package_data=True,
|
||||||
|
license='BSD License', # example license
|
||||||
|
)
|
||||||
Loading…
x
Reference in New Issue
Block a user