mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-09-02 11:08:01 +02:00
Flask directory upload POC, embed datasheet.info in html comment for parser reuse
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import requests
|
||||
import os
|
||||
import sys
|
||||
# TODO
|
||||
# copy directory structure
|
||||
# relative links to not break dataseets?
|
||||
# look into proper string and packet sanitization
|
||||
# index gui + results graphs
|
||||
|
||||
base_url = 'http://localhost:5000/'
|
||||
upload_url = 'upload'
|
||||
|
||||
def send_file(path):
|
||||
upload_file = open(path,'rb')
|
||||
data = {'file' : upload_file}
|
||||
return requests.post(url = base_url + upload_url, files = data)
|
||||
|
||||
def send_mkdir(path):
|
||||
|
||||
def send_directory(path):
|
||||
for root, directories, filenames in os.walk(path):
|
||||
for filename in filenames:
|
||||
upload_file = os.path.join(root,filename)
|
||||
print(upload_file)
|
||||
print(send_file(upload_file))
|
||||
|
||||
send_directory(sys.argv[1])
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
test
|
||||
Reference in New Issue
Block a user