RemoteRF 0.0.7.52__tar.gz → 0.0.7.54__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.7.52/src/remoteRF.egg-info → remoterf-0.0.7.54}/PKG-INFO +1 -1
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/setup.py +1 -1
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/app.py +83 -12
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/grpc_acc.py +1 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54/src/remoteRF.egg-info}/PKG-INFO +1 -1
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/LICENSE +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/MANIFEST.in +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/README.md +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/setup.cfg +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/grpc/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/grpc/grpc_pb2.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/utils/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/utils/ansi_codes.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/utils/api_token.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/utils/list_string.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/common/utils/process_arg.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/config/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/config/cert_fetcher.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/config/config.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/acc_login.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/grpc_client.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/core/version.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/drivers/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/drivers/adalm_pluto/pluto_remote.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF/remoterf_cli.py +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF.egg-info/SOURCES.txt +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF.egg-info/dependency_links.txt +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF.egg-info/entry_points.txt +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF.egg-info/requires.txt +0 -0
- {remoterf-0.0.7.52 → remoterf-0.0.7.54}/src/remoteRF.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 0.0.7.
|
|
3
|
+
Version: 0.0.7.54
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author: Ethan Ge
|
|
6
6
|
Author-email: ethoGalaxy@gmail.com
|
|
@@ -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.7.
|
|
9
|
+
version="0.0.7.54",
|
|
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! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.",
|
|
@@ -264,24 +264,95 @@ def reserve():
|
|
|
264
264
|
except Exception as e:
|
|
265
265
|
printf(f"Error: {e}", Sty.BRIGHT_RED)
|
|
266
266
|
|
|
267
|
+
import ast
|
|
268
|
+
import json
|
|
269
|
+
|
|
267
270
|
def perms():
|
|
268
271
|
data = account.get_perms()
|
|
269
272
|
if 'ace' in data.results:
|
|
270
273
|
print(f"Error: {unmap_arg(data.results['ace'])}")
|
|
271
274
|
return
|
|
272
|
-
|
|
275
|
+
|
|
273
276
|
results = ast.literal_eval(unmap_arg(data.results['UC']))[0]
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
perm_level = results[0]
|
|
278
|
+
|
|
279
|
+
printf("Permission Level: ", Sty.BOLD, f"{perm_level}", Sty.BLUE)
|
|
280
|
+
|
|
281
|
+
if perm_level == "Normal User":
|
|
282
|
+
details_raw = unmap_arg(data.results.get("details", map_arg("{}")))
|
|
283
|
+
try:
|
|
284
|
+
details = json.loads(details_raw) if details_raw else {}
|
|
285
|
+
except Exception:
|
|
286
|
+
details = {}
|
|
287
|
+
|
|
288
|
+
devices = details.get("devices", []) or []
|
|
289
|
+
caps = details.get("caps", {}) or {}
|
|
290
|
+
|
|
291
|
+
def _cap_for(dev_id: int):
|
|
292
|
+
return caps.get(str(dev_id)) or caps.get(dev_id) or {}
|
|
293
|
+
|
|
294
|
+
if not devices:
|
|
295
|
+
printf("Devices: ", Sty.DEFAULT, "None", Sty.MAGENTA)
|
|
296
|
+
return
|
|
297
|
+
|
|
298
|
+
printf("Devices allowed: ", Sty.DEFAULT, f"{devices}", Sty.MAGENTA)
|
|
299
|
+
|
|
300
|
+
# Build per-device caps and group identical limits together
|
|
301
|
+
buckets: dict[tuple[int, int], list[int]] = {} # (max_r, max_t_sec) -> [dev_ids]
|
|
302
|
+
for d in devices:
|
|
303
|
+
try:
|
|
304
|
+
did = int(d)
|
|
305
|
+
except Exception:
|
|
306
|
+
continue
|
|
307
|
+
c = _cap_for(did)
|
|
308
|
+
max_t = int(c.get("max_reservation_time_sec", 0) or 0)
|
|
309
|
+
max_r = int(c.get("max_reservations", 0) or 0)
|
|
310
|
+
buckets.setdefault((max_r, max_t), []).append(did)
|
|
311
|
+
|
|
312
|
+
if not buckets:
|
|
313
|
+
print("Limits per device: (none)")
|
|
314
|
+
return
|
|
315
|
+
|
|
316
|
+
# If everything shares the same limits, print once
|
|
317
|
+
if len(buckets) == 1:
|
|
318
|
+
(max_r, max_t), devs = next(iter(buckets.items()))
|
|
319
|
+
print("Limits (all devices):")
|
|
320
|
+
print(f" Max Concurrent Reservations: {max_r} \n Max Reservation Duration (min): {max_t // 60}")
|
|
321
|
+
return
|
|
322
|
+
|
|
323
|
+
# Otherwise print grouped limits
|
|
324
|
+
print("Limits per device (grouped):")
|
|
325
|
+
for (max_r, max_t), devs in sorted(buckets.items(), key=lambda kv: (kv[0][0], kv[0][1], kv[1])):
|
|
326
|
+
devs = sorted(devs)
|
|
327
|
+
# compress ranges like 0-3,5,7-9
|
|
328
|
+
ranges = []
|
|
329
|
+
start = prev = None
|
|
330
|
+
for x in devs:
|
|
331
|
+
if start is None:
|
|
332
|
+
start = prev = x
|
|
333
|
+
continue
|
|
334
|
+
if x == prev + 1:
|
|
335
|
+
prev = x
|
|
336
|
+
else:
|
|
337
|
+
ranges.append(f"{start}-{prev}" if start != prev else f"{start}")
|
|
338
|
+
start = prev = x
|
|
339
|
+
if start is not None:
|
|
340
|
+
ranges.append(f"{start}-{prev}" if start != prev else f"{start}")
|
|
341
|
+
dev_str = ",".join(ranges)
|
|
342
|
+
|
|
343
|
+
print(f" devices[{dev_str}]: max_reservations={max_r}, max_time_min={max_t // 60}")
|
|
344
|
+
|
|
345
|
+
elif perm_level == "Power User":
|
|
346
|
+
printf("Max Reservations: ", Sty.DEFAULT, f"{results[3]}", Sty.MAGENTA)
|
|
347
|
+
printf("Max Reservation Duration (min): ", Sty.DEFAULT, f"{int(results[4]/60)}", Sty.MAGENTA)
|
|
348
|
+
printf("Device IDs allowed Access to: ", Sty.DEFAULT, f"{results[5]}", Sty.MAGENTA)
|
|
349
|
+
|
|
350
|
+
elif perm_level == "Admin":
|
|
351
|
+
printf("No restrictions on reservation count or duration.", Sty.DEFAULT)
|
|
352
|
+
|
|
283
353
|
else:
|
|
284
|
-
printf(f"Error: Unknown permission level {
|
|
354
|
+
printf(f"Error: Unknown permission level {perm_level}", Sty.BRIGHT_RED)
|
|
355
|
+
|
|
285
356
|
|
|
286
357
|
def enroll():
|
|
287
358
|
code = session.prompt(stylize("Enter your enrollment code: ", Sty.DEFAULT))
|
|
@@ -293,7 +364,7 @@ def enroll():
|
|
|
293
364
|
return
|
|
294
365
|
else:
|
|
295
366
|
# todo: print out specifics, like group name (ie: successfully enrolled in ECE 132A)
|
|
296
|
-
printf("Enrollment successful.", Sty.
|
|
367
|
+
printf("Enrollment successful.", Sty.BG_GREEN)
|
|
297
368
|
|
|
298
369
|
# New block scheduling
|
|
299
370
|
|
|
@@ -10,6 +10,7 @@ class RemoteRFAccount:
|
|
|
10
10
|
self.password = password
|
|
11
11
|
self.email = email
|
|
12
12
|
self.enrollment_code = ""
|
|
13
|
+
self.is_admin = False
|
|
13
14
|
|
|
14
15
|
def create_user(self):
|
|
15
16
|
response = rpc_client(function_name="ACC:create_user", args={"un":map_arg(self.username), "pw":map_arg(self.password), "em":map_arg(self.email), "ec":map_arg(self.enrollment_code)})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 0.0.7.
|
|
3
|
+
Version: 0.0.7.54
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author: Ethan Ge
|
|
6
6
|
Author-email: ethoGalaxy@gmail.com
|
|
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
|