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