old idk
This commit is contained in:
parent
f6ba365dbe
commit
f55cfef16c
5
fetch.py
5
fetch.py
|
@ -1,5 +1,6 @@
|
||||||
import requests
|
import requests
|
||||||
from os import path
|
from os import path
|
||||||
|
from adg_control import ADG_DIR
|
||||||
|
|
||||||
|
|
||||||
class DriverUrl:
|
class DriverUrl:
|
||||||
|
@ -35,7 +36,7 @@ def get_driver_by_exact_name(name: str) -> DriverUrl:
|
||||||
try:
|
try:
|
||||||
res = next(driver for driver in drivers if driver.name == name)
|
res = next(driver for driver in drivers if driver.name == name)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
raise Exception("Driver not found")
|
raise Exception("Driver not found", name)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -98,6 +99,8 @@ def download_driver(driver: DriverUrl, dir: str):
|
||||||
for chunk in res.iter_content(chunk_size=128):
|
for chunk in res.iter_content(chunk_size=128):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
|
|
||||||
|
return file_name
|
||||||
|
|
||||||
|
|
||||||
def read_credentials() -> (str, str):
|
def read_credentials() -> (str, str):
|
||||||
token = ""
|
token = ""
|
||||||
|
|
|
@ -116,6 +116,7 @@ class Command():
|
||||||
else:
|
else:
|
||||||
abs_path = cache.get(self.device)
|
abs_path = cache.get(self.device)
|
||||||
package_path = ntpath.relpath(abs_path, start=ADG_DIR)
|
package_path = ntpath.relpath(abs_path, start=ADG_DIR)
|
||||||
|
print(abs_path, package_path)
|
||||||
|
|
||||||
client.create_normal_resource(
|
client.create_normal_resource(
|
||||||
self.name,
|
self.name,
|
||||||
|
|
Loading…
Reference in New Issue