pmxt 1.0.0b8__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pmxt/__init__.py +1 -1
- pmxt/client.py +7 -1
- pmxt/server_manager.py +15 -0
- {pmxt-1.0.0b8.dist-info → pmxt-1.0.1.dist-info}/METADATA +1 -1
- {pmxt-1.0.0b8.dist-info → pmxt-1.0.1.dist-info}/RECORD +10 -10
- pmxt_internal/__init__.py +1 -1
- pmxt_internal/api_client.py +1 -1
- pmxt_internal/configuration.py +1 -1
- {pmxt-1.0.0b8.dist-info → pmxt-1.0.1.dist-info}/WHEEL +0 -0
- {pmxt-1.0.0b8.dist-info → pmxt-1.0.1.dist-info}/top_level.txt +0 -0
pmxt/__init__.py
CHANGED
pmxt/client.py
CHANGED
|
@@ -182,6 +182,12 @@ class Exchange(ABC):
|
|
|
182
182
|
if auto_start_server:
|
|
183
183
|
try:
|
|
184
184
|
self._server_manager.ensure_server_running()
|
|
185
|
+
|
|
186
|
+
# Get the actual port the server is running on
|
|
187
|
+
# (may differ from default if default port was busy)
|
|
188
|
+
actual_port = self._server_manager.get_running_port()
|
|
189
|
+
base_url = f"http://localhost:{actual_port}"
|
|
190
|
+
|
|
185
191
|
except Exception as e:
|
|
186
192
|
raise Exception(
|
|
187
193
|
f"Failed to start PMXT server: {e}\n\n"
|
|
@@ -189,7 +195,7 @@ class Exchange(ABC):
|
|
|
189
195
|
f"Or start the server manually: pmxt-server"
|
|
190
196
|
)
|
|
191
197
|
|
|
192
|
-
# Configure the API client
|
|
198
|
+
# Configure the API client with the actual base URL
|
|
193
199
|
config = Configuration(host=base_url)
|
|
194
200
|
self._api_client = ApiClient(configuration=config)
|
|
195
201
|
self._api = DefaultApi(api_client=self._api_client)
|
pmxt/server_manager.py
CHANGED
|
@@ -240,3 +240,18 @@ class ServerManager:
|
|
|
240
240
|
return json.loads(self.lock_path.read_text())
|
|
241
241
|
except:
|
|
242
242
|
return None
|
|
243
|
+
|
|
244
|
+
def get_running_port(self) -> int:
|
|
245
|
+
"""
|
|
246
|
+
Get the actual port the server is running on.
|
|
247
|
+
|
|
248
|
+
This reads the lock file to determine the actual port,
|
|
249
|
+
which may differ from the default if the default port was busy.
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
Port number the server is running on, or DEFAULT_PORT if unknown
|
|
253
|
+
"""
|
|
254
|
+
info = self.get_server_info()
|
|
255
|
+
if info and 'port' in info:
|
|
256
|
+
return info['port']
|
|
257
|
+
return self.DEFAULT_PORT
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
pmxt/__init__.py,sha256=
|
|
2
|
-
pmxt/client.py,sha256=
|
|
1
|
+
pmxt/__init__.py,sha256=I84TjHQFVD84qYfgQzAipnaxF54NBoeOzlOS7eL_xps,1150
|
|
2
|
+
pmxt/client.py,sha256=pXAPl_IPhnza2xwlObSlLia9aWpBHA97Nsxq9aP3yvU,23485
|
|
3
3
|
pmxt/models.py,sha256=Mu0hLVjQU3PM5m68poK61VQcJtPQ8ZdLdLU7pq1lqjQ,6004
|
|
4
|
-
pmxt/server_manager.py,sha256=
|
|
5
|
-
pmxt_internal/__init__.py,sha256=
|
|
6
|
-
pmxt_internal/api_client.py,sha256=
|
|
4
|
+
pmxt/server_manager.py,sha256=XmvNhBia3ex7XyIcxy2pIdoCHu_Y4R7tKSEWrw2jaKc,8320
|
|
5
|
+
pmxt_internal/__init__.py,sha256=C-gVAVkcuSGwGO_RizwP6CcUywnL6GEln8n5fWdPGkg,5973
|
|
6
|
+
pmxt_internal/api_client.py,sha256=Or2AVtohO9R9hWORQWYvSNeI09cjANbSDG-VtnHhyHY,27889
|
|
7
7
|
pmxt_internal/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
8
|
-
pmxt_internal/configuration.py,sha256=
|
|
8
|
+
pmxt_internal/configuration.py,sha256=tm1iEGbjjtgFaNzwQILH6xZLUyy8TwllHcn9QZDElHM,18320
|
|
9
9
|
pmxt_internal/exceptions.py,sha256=txF8A7vlan57JS69kFPs-IZF-Qhp7IZobBTJVa4fOaM,6644
|
|
10
10
|
pmxt_internal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
pmxt_internal/rest.py,sha256=FMj4yaV6XLr842u_ScWHSzQsTFdk0jaUeuWLJoRbogQ,9760
|
|
@@ -50,7 +50,7 @@ pmxt_internal/models/search_markets_request.py,sha256=BARoy2GXgV7RQNIGck6UaOyQqf
|
|
|
50
50
|
pmxt_internal/models/search_markets_request_args_inner.py,sha256=PkusFd_OxhUsItsBpluPJA11zg0sXXjbOK-lPmemvLs,5561
|
|
51
51
|
pmxt_internal/models/trade.py,sha256=U6Fc18rbwILs9FmX8CSDYYL8dF6763l8QzeMQNRxQdo,3328
|
|
52
52
|
pmxt_internal/models/unified_market.py,sha256=mNyUrGKWxvI2f2KCa2uhGwq22cBdDia2hD5AtzFw8fE,4487
|
|
53
|
-
pmxt-1.0.
|
|
54
|
-
pmxt-1.0.
|
|
55
|
-
pmxt-1.0.
|
|
56
|
-
pmxt-1.0.
|
|
53
|
+
pmxt-1.0.1.dist-info/METADATA,sha256=POG07mOia5wAMbM4z41CIFipNWp3XOZneA2N9mcHTuA,6300
|
|
54
|
+
pmxt-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
pmxt-1.0.1.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
|
|
56
|
+
pmxt-1.0.1.dist-info/RECORD,,
|
pmxt_internal/__init__.py
CHANGED
pmxt_internal/api_client.py
CHANGED
|
@@ -91,7 +91,7 @@ class ApiClient:
|
|
|
91
91
|
self.default_headers[header_name] = header_value
|
|
92
92
|
self.cookie = cookie
|
|
93
93
|
# Set default User-Agent.
|
|
94
|
-
self.user_agent = 'OpenAPI-Generator/1.0.
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/1.0.1/python'
|
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
|
96
96
|
|
|
97
97
|
def __enter__(self):
|
pmxt_internal/configuration.py
CHANGED
|
@@ -506,7 +506,7 @@ class Configuration:
|
|
|
506
506
|
"OS: {env}\n"\
|
|
507
507
|
"Python Version: {pyversion}\n"\
|
|
508
508
|
"Version of the API: 0.4.4\n"\
|
|
509
|
-
"SDK Package Version: 1.0.
|
|
509
|
+
"SDK Package Version: 1.0.1".\
|
|
510
510
|
format(env=sys.platform, pyversion=sys.version)
|
|
511
511
|
|
|
512
512
|
def get_host_settings(self) -> List[HostSetting]:
|
|
File without changes
|
|
File without changes
|