simplex 1.2.32__py3-none-any.whl → 1.2.33__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.

Potentially problematic release.


This version of simplex might be problematic. Click here for more details.

simplex/simplex.py CHANGED
@@ -344,15 +344,27 @@ class Simplex:
344
344
  else:
345
345
  raise ValueError(f"Failed to create login session: {response.json()['error']}")
346
346
 
347
- def restore_login_session(self, session_data_filepath: str, cdp_url: str = None):
348
- filename = session_data_filepath
347
+ def restore_login_session(self, session_data: str, cdp_url: str = None):
348
+ """
349
+ Restore a login session from either a file path or a JSON string.
349
350
 
350
- with open(filename, 'r') as f:
351
- session_data = json.load(f)
351
+ Args:
352
+ session_data: Either a file path to JSON file or a JSON string
353
+ cdp_url: Optional CDP URL for remote debugging
354
+ """
355
+ try:
356
+ # Try to parse as JSON string first
357
+ session_data_dict = json.loads(session_data)
358
+ except json.JSONDecodeError:
359
+ # If parsing fails, treat as file path
360
+ try:
361
+ with open(session_data, 'r') as f:
362
+ session_data_dict = json.load(f)
363
+ except Exception as e:
364
+ raise ValueError(f"Failed to load session data. Input must be valid JSON string or path to JSON file. Error: {str(e)}")
352
365
 
353
- # Serialize the data to JSON string
354
366
  data = {
355
- 'session_data': json.dumps(session_data) # Serialize the session_data
367
+ 'session_data': json.dumps(session_data_dict)
356
368
  }
357
369
  if cdp_url:
358
370
  data['cdp_url'] = cdp_url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.32
3
+ Version: 1.2.33
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -0,0 +1,11 @@
1
+ simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
2
+ simplex/cli.py,sha256=FlZPWx014wpIy3TWYxhv8pANoPG9UWoq-ipkEIaiJAU,2389
3
+ simplex/simplex.py,sha256=jYmeXQx09FneIl9_XjLWJ0v_EvY6jqlwHCmMoJYPkTE,17653
4
+ simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
+ simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
+ simplex-1.2.33.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
+ simplex-1.2.33.dist-info/METADATA,sha256=EVVVPa7m5G4P9ZK2UCAQRCSa6iFtDNeyqV8qbJLYTnI,938
8
+ simplex-1.2.33.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ simplex-1.2.33.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
+ simplex-1.2.33.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
+ simplex-1.2.33.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
2
- simplex/cli.py,sha256=FlZPWx014wpIy3TWYxhv8pANoPG9UWoq-ipkEIaiJAU,2389
3
- simplex/simplex.py,sha256=Tt2iV-nTOCPkT-4_R_ra8nuoAAS3_oXXn1iwFv_7cjE,17107
4
- simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
- simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
- simplex-1.2.32.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
- simplex-1.2.32.dist-info/METADATA,sha256=EutvHKxpkBsuxxgSw8jwRzMzFkqpG-upH--UTZ5uXEg,938
8
- simplex-1.2.32.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- simplex-1.2.32.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
- simplex-1.2.32.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
- simplex-1.2.32.dist-info/RECORD,,