RemoteRF 0.0.6.7__tar.gz → 0.0.6.9__tar.gz
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.
- {remoterf-0.0.6.7/src/remoteRF.egg-info → remoterf-0.0.6.9}/PKG-INFO +1 -1
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/setup.py +1 -1
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/drivers/adalm_pluto/pluto_remote.py +2 -4
- remoterf-0.0.6.9/src/remoteRF/drivers/adalm_pluto/pluto_wrapper.py +67 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9/src/remoteRF.egg-info}/PKG-INFO +1 -1
- remoterf-0.0.6.7/src/remoteRF/drivers/adalm_pluto/pluto_wrapper.py +0 -73
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/LICENSE +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/MANIFEST.in +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/README.md +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/setup.cfg +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/grpc/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/grpc/grpc_pb2.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/utils/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/utils/ansi_codes.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/utils/api_token.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/utils/list_string.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/common/utils/process_arg.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/acc_login.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/app.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/ca.crt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/ca.key +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/cert.pem +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/key.pem +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/server.crt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/certs/server.key +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/grpc_acc.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/core/grpc_client.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/drivers/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF.egg-info/SOURCES.txt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF.egg-info/dependency_links.txt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF.egg-info/entry_points.txt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF.egg-info/requires.txt +0 -0
- {remoterf-0.0.6.7 → remoterf-0.0.6.9}/src/remoteRF.egg-info/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="remoteRF",
|
|
9
|
-
version="0.0.6.
|
|
9
|
+
version="0.0.6.9",
|
|
10
10
|
author="Ethan Ge",
|
|
11
11
|
author_email="ethoGalaxy@gmail.com",
|
|
12
12
|
description="A python API to remotely access signal centric hardware. Client-side only!",
|
|
@@ -30,7 +30,7 @@ class Pluto(metaclass=WrapperMeta): # client
|
|
|
30
30
|
|
|
31
31
|
def try_get(self, *, function_name):
|
|
32
32
|
try:
|
|
33
|
-
return rpc_client(function_name=f"Pluto:{function_name}:GET", args={'a':map_arg(self.token)}).results[function_name]
|
|
33
|
+
return unmap_arg(rpc_client(function_name=f"Pluto:{function_name}:GET", args={'a':map_arg(self.token)}).results[function_name])
|
|
34
34
|
except Exception as e:
|
|
35
35
|
input(f"Error: {e}\nHit enter to continue...")
|
|
36
36
|
return None
|
|
@@ -152,10 +152,8 @@ class Pluto(metaclass=WrapperMeta): # client
|
|
|
152
152
|
|
|
153
153
|
#region rx_def
|
|
154
154
|
|
|
155
|
-
@property
|
|
156
155
|
def rx(self):
|
|
157
|
-
|
|
158
|
-
# return unmap_arg(self.try_get(function_name="rx"))
|
|
156
|
+
return unmap_arg(self.try_get(function_name="rx"))
|
|
159
157
|
|
|
160
158
|
@property
|
|
161
159
|
def rx_buffer_size(self):
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from ...core import rpc_client
|
|
2
|
+
from ...common.utils.process_arg import map_arg
|
|
3
|
+
|
|
4
|
+
import inspect
|
|
5
|
+
from functools import wraps
|
|
6
|
+
|
|
7
|
+
def method_wrapper(method):
|
|
8
|
+
@wraps(method)
|
|
9
|
+
def wrapped(self, *args, **kwargs): # No methods are present in Pluto Script
|
|
10
|
+
# Access instance attributes like self.token
|
|
11
|
+
# print(f"Method called: {method.__name__} with self.token: {self.token}")
|
|
12
|
+
# Modify behavior as needed
|
|
13
|
+
# For example, redirect the call
|
|
14
|
+
# return self.try_get(function_name=method.__name__)
|
|
15
|
+
return method(self, *args, **kwargs)
|
|
16
|
+
return wrapped
|
|
17
|
+
|
|
18
|
+
def property_wrapper(prop):
|
|
19
|
+
# Wrap the getter
|
|
20
|
+
if prop.fget:
|
|
21
|
+
@wraps(prop.fget)
|
|
22
|
+
def getter(self):
|
|
23
|
+
print(f"Getting property: {prop.fget.__name__} with self.token: {self.token}")
|
|
24
|
+
# Redirect or modify behavior here
|
|
25
|
+
return self.try_get(function_name=prop.fget.__name__)
|
|
26
|
+
else:
|
|
27
|
+
getter = None
|
|
28
|
+
|
|
29
|
+
# Wrap the setter
|
|
30
|
+
if prop.fset:
|
|
31
|
+
@wraps(prop.fset)
|
|
32
|
+
def setter(self, value):
|
|
33
|
+
print(f"Setting property: {prop.fset.__name__} to {value} with self.token: {self.token}")
|
|
34
|
+
# Redirect or modify behavior here
|
|
35
|
+
self.try_set(function_name=prop.fset.__name__, value=value)
|
|
36
|
+
else:
|
|
37
|
+
setter = None
|
|
38
|
+
|
|
39
|
+
# Wrap the deleter
|
|
40
|
+
if prop.fdel:
|
|
41
|
+
@wraps(prop.fdel)
|
|
42
|
+
def deleter(self):
|
|
43
|
+
print(f"Deleting property: {prop.fdel.__name__}")
|
|
44
|
+
# Redirect or modify behavior here
|
|
45
|
+
prop.fdel(self)
|
|
46
|
+
else:
|
|
47
|
+
deleter = None
|
|
48
|
+
|
|
49
|
+
return property(getter, setter, deleter)
|
|
50
|
+
|
|
51
|
+
class WrapperMeta(type):
|
|
52
|
+
def __new__(cls, name, bases, dct):
|
|
53
|
+
new_dct = {}
|
|
54
|
+
for attr_name, attr_value in dct.items():
|
|
55
|
+
if attr_name.startswith('__') and attr_name.endswith('__'):
|
|
56
|
+
# Skip dunder methods
|
|
57
|
+
new_dct[attr_name] = attr_value
|
|
58
|
+
continue
|
|
59
|
+
if callable(attr_value):
|
|
60
|
+
# Wrap methods
|
|
61
|
+
new_dct[attr_name] = method_wrapper(attr_value)
|
|
62
|
+
elif isinstance(attr_value, property):
|
|
63
|
+
# Wrap properties
|
|
64
|
+
new_dct[attr_name] = property_wrapper(attr_value)
|
|
65
|
+
else:
|
|
66
|
+
new_dct[attr_name] = attr_value
|
|
67
|
+
return super().__new__(cls, name, bases, new_dct)
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from ...core import rpc_client
|
|
2
|
-
from ...common.utils.process_arg import map_arg
|
|
3
|
-
|
|
4
|
-
import inspect
|
|
5
|
-
from functools import wraps
|
|
6
|
-
|
|
7
|
-
# def method_wrapper(method):
|
|
8
|
-
# @wraps(method)
|
|
9
|
-
# def wrapped(self, *args, **kwargs): # No methods are present in Pluto Script
|
|
10
|
-
# # Access instance attributes like self.token
|
|
11
|
-
# # print(f"Method called: {method.__name__} with self.token: {self.token}")
|
|
12
|
-
# # Modify behavior as needed
|
|
13
|
-
# # For example, redirect the call
|
|
14
|
-
# # return self.try_get(function_name=method.__name__)
|
|
15
|
-
# return
|
|
16
|
-
# return wrapped
|
|
17
|
-
|
|
18
|
-
def property_wrapper(prop):
|
|
19
|
-
# Wrap the getter
|
|
20
|
-
if prop.fget:
|
|
21
|
-
@wraps(prop.fget)
|
|
22
|
-
def getter(self):
|
|
23
|
-
print(f"Getting property: {prop.fget.__name__} with self.token: {self.token}")
|
|
24
|
-
# Redirect or modify behavior here
|
|
25
|
-
return self.try_get(function_name=prop.fget.__name__)
|
|
26
|
-
else:
|
|
27
|
-
getter = None
|
|
28
|
-
|
|
29
|
-
# Wrap the setter
|
|
30
|
-
if prop.fset:
|
|
31
|
-
@wraps(prop.fset)
|
|
32
|
-
def setter(self, value):
|
|
33
|
-
print(f"Setting property: {prop.fset.__name__} to {value} with self.token: {self.token}")
|
|
34
|
-
# Redirect or modify behavior here
|
|
35
|
-
self.try_set(function_name=prop.fset.__name__, value=value)
|
|
36
|
-
else:
|
|
37
|
-
setter = None
|
|
38
|
-
|
|
39
|
-
# Wrap the deleter
|
|
40
|
-
if prop.fdel:
|
|
41
|
-
@wraps(prop.fdel)
|
|
42
|
-
def deleter(self):
|
|
43
|
-
print(f"Deleting property: {prop.fdel.__name__}")
|
|
44
|
-
# Redirect or modify behavior here
|
|
45
|
-
prop.fdel(self)
|
|
46
|
-
else:
|
|
47
|
-
deleter = None
|
|
48
|
-
|
|
49
|
-
return property(getter, setter, deleter)
|
|
50
|
-
|
|
51
|
-
class WrapperMeta(type):
|
|
52
|
-
def __new__(cls, name, bases, dct):
|
|
53
|
-
# Create the class object first
|
|
54
|
-
cls_obj = super().__new__(cls, name, bases, dct)
|
|
55
|
-
wrapped_methods = set()
|
|
56
|
-
|
|
57
|
-
# Iterate over the MRO to include inherited methods and properties
|
|
58
|
-
for base in cls_obj.__mro__:
|
|
59
|
-
for attr_name, attr_value in base.__dict__.items():
|
|
60
|
-
if attr_name in wrapped_methods or attr_name.startswith('__') and attr_name.endswith('__'):
|
|
61
|
-
continue
|
|
62
|
-
|
|
63
|
-
# if callable(attr_value):
|
|
64
|
-
# # Wrap methods
|
|
65
|
-
# setattr(cls_obj, attr_name, method_wrapper(attr_value))
|
|
66
|
-
# wrapped_methods.add(attr_name)
|
|
67
|
-
|
|
68
|
-
if isinstance(attr_value, property):
|
|
69
|
-
# Wrap properties
|
|
70
|
-
setattr(cls_obj, attr_name, property_wrapper(attr_value))
|
|
71
|
-
wrapped_methods.add(attr_name)
|
|
72
|
-
|
|
73
|
-
return cls_obj
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|