Commit 6927a3eb by aa.gusti

upload

1 parent c2c52d75
......@@ -386,6 +386,8 @@ def file_type(filename):
class SaveFile(object):
def __init__(self, dir_path):
self.dir_path = dir_path
if not os.path.exists(dir_path):
os.makedirs(dir_path)
# Unchanged file extension, and make file prefix unique with sequential
# number.
......@@ -420,7 +422,7 @@ class Upload(SaveFile):
def save(self, request, name):
input_file = request.POST[name].file
ext = get_ext(request.POST[name].filename)
self.save_to_file(input_file, ext)
return self.save_to_file(input_file, ext)
def saves(self, uploads):
d = {}
......@@ -436,7 +438,7 @@ class Upload(SaveFile):
class MemoryTmpStore(dict):
""" Instances of this class implement the
:class:`deform.interfaces.FileUploadTempStore` interface"""
:class:`defWorm.interfaces.FileUploadTempStore` interface"""
def preview_url(self, uid):
return None
......
......@@ -244,6 +244,7 @@ def get_seconds(current_time=None):
if not current_time:
current_time = datetime.utcnow()
durasi = current_time - begin_unix_time
log.info(f"{current_time} - {begin_unix_time}")
return int(durasi.total_seconds())
......
setuptools>=40.8.0
pip>=21.2.4
pip~=18.1
WebOb>=1.8.7
certifi>=2021.5.30
pyramid>=2.0
......@@ -9,4 +9,50 @@ translationstring>=1.4
plaster>=1.0
hupper>=1.10.3
urllib3>=1.26.6
idna>=3.2
\ No newline at end of file
idna>=3.2
SQLAlchemy~=1.4.25
requests~=2.26.0
colander~=1.8.3
deform~=2.0.15
transaction~=3.0.1
python-dateutil~=2.8.2
google~=3.0.0
alembic~=1.7.3
pytz~=2021.3
py~=1.10.0
colorama~=0.4.4
Pillow~=8.3.2
lxml~=4.6.3
beautifulsoup4~=4.10.0
soupsieve~=2.2.1
wheel~=0.37.0
rsa~=4.7.2
pyasn1~=0.4.8
attrs~=21.2.0
Mako~=1.1.5
Babel~=2.9.1
Beaker~=1.11.0
Pygments~=2.10.0
MarkupSafe~=2.0.1
six~=1.16.0
Genshi~=0.7.5
toml~=0.10.2
Chameleon~=3.9.1
peppercorn~=0.6
iso8601~=0.1.16
cachetools~=4.2.4
google-api-python-client~=2.23.0
pytest~=6.2.5
pluggy~=1.0.0
iniconfig~=1.1.1
passlib~=1.7.4
greenlet~=1.1.2
pyparsing~=2.4.7
httplib2~=0.19.1
icecream~=2.1.1
executing~=0.8.2
paginate~=0.5.6
waitress~=2.0.0
asttokens~=2.0.5
uritemplate~=3.0.1
zipp~=3.6.0
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!