Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6927a3eb
authored
Apr 21, 2022
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
upload
1 parent
c2c52d75
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
opensipkd/tools/__init__.py
opensipkd/tools/api.py
requirements.txt
opensipkd/tools/__init__.py
View file @
6927a3e
...
@@ -386,6 +386,8 @@ def file_type(filename):
...
@@ -386,6 +386,8 @@ def file_type(filename):
class
SaveFile
(
object
):
class
SaveFile
(
object
):
def
__init__
(
self
,
dir_path
):
def
__init__
(
self
,
dir_path
):
self
.
dir_path
=
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
# Unchanged file extension, and make file prefix unique with sequential
# number.
# number.
...
@@ -420,7 +422,7 @@ class Upload(SaveFile):
...
@@ -420,7 +422,7 @@ class Upload(SaveFile):
def
save
(
self
,
request
,
name
):
def
save
(
self
,
request
,
name
):
input_file
=
request
.
POST
[
name
]
.
file
input_file
=
request
.
POST
[
name
]
.
file
ext
=
get_ext
(
request
.
POST
[
name
]
.
filename
)
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
):
def
saves
(
self
,
uploads
):
d
=
{}
d
=
{}
...
@@ -436,7 +438,7 @@ class Upload(SaveFile):
...
@@ -436,7 +438,7 @@ class Upload(SaveFile):
class
MemoryTmpStore
(
dict
):
class
MemoryTmpStore
(
dict
):
""" Instances of this class implement the
""" Instances of this class implement the
:class:`deform.interfaces.FileUploadTempStore` interface"""
:class:`def
W
orm.interfaces.FileUploadTempStore` interface"""
def
preview_url
(
self
,
uid
):
def
preview_url
(
self
,
uid
):
return
None
return
None
...
...
opensipkd/tools/api.py
View file @
6927a3e
...
@@ -244,6 +244,7 @@ def get_seconds(current_time=None):
...
@@ -244,6 +244,7 @@ def get_seconds(current_time=None):
if
not
current_time
:
if
not
current_time
:
current_time
=
datetime
.
utcnow
()
current_time
=
datetime
.
utcnow
()
durasi
=
current_time
-
begin_unix_time
durasi
=
current_time
-
begin_unix_time
log
.
info
(
f
"{current_time} - {begin_unix_time}"
)
return
int
(
durasi
.
total_seconds
())
return
int
(
durasi
.
total_seconds
())
...
...
requirements.txt
View file @
6927a3e
setuptools>=40.8.0
setuptools>=40.8.0
pip
>=21.2.4
pip
~=18.1
WebOb>=1.8.7
WebOb>=1.8.7
certifi>=2021.5.30
certifi>=2021.5.30
pyramid>=2.0
pyramid>=2.0
...
@@ -10,3 +10,49 @@ plaster>=1.0
...
@@ -10,3 +10,49 @@ plaster>=1.0
hupper>=1.10.3
hupper>=1.10.3
urllib3>=1.26.6
urllib3>=1.26.6
idna>=3.2
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
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment