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 b0a3cd23
authored
Dec 19, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
perbaikan upload
2 parents
ed268c24
ac4770c0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
opensipkd/tools/__init__.py
opensipkd/tools/tools.init
opensipkd/tools/__init__.py
View file @
b0a3cd2
...
@@ -214,11 +214,12 @@ def time_from_str(value):
...
@@ -214,11 +214,12 @@ def time_from_str(value):
# return datetime.time(h, m, s)
# return datetime.time(h, m, s)
return
datetime
.
timedelta
(
hours
=
int
(
h
),
minutes
=
int
(
m
),
seconds
=
int
(
s
))
return
datetime
.
timedelta
(
hours
=
int
(
h
),
minutes
=
int
(
m
),
seconds
=
int
(
s
))
def
datetime_from_str
(
value
):
def
datetime_from_str
(
value
):
# separator = None
# separator = None
dt
=
date_from_str
(
value
)
dt
=
date_from_str
(
value
)
tm
=
time_from_str
(
value
)
tm
=
time_from_str
(
value
)
return
datetime
.
datetime
(
dt
.
year
,
dt
.
month
,
dt
.
day
)
+
tm
return
datetime
.
datetime
(
dt
.
year
,
dt
.
month
,
dt
.
day
)
+
tm
def
dmy
(
tgl
):
def
dmy
(
tgl
):
...
@@ -478,7 +479,8 @@ class Upload(SaveFile):
...
@@ -478,7 +479,8 @@ class Upload(SaveFile):
return
filename
return
filename
def
save_fp
(
self
,
upload
):
def
save_fp
(
self
,
upload
):
if
'fp'
not
in
upload
or
upload
[
'fp'
]
==
b
''
or
not
upload
[
'fp'
]
or
not
upload
[
'size'
]:
if
'fp'
not
in
upload
or
upload
[
'fp'
]
==
b
''
or
not
upload
[
'fp'
]
or
not
\
upload
[
'size'
]:
if
"filename"
in
upload
:
if
"filename"
in
upload
:
return
upload
[
'filename'
]
return
upload
[
'filename'
]
return
return
...
@@ -1029,6 +1031,6 @@ def create_static_path(config, folder, url, cache_max_age=3600):
...
@@ -1029,6 +1031,6 @@ def create_static_path(config, folder, url, cache_max_age=3600):
config
.
add_static_view
(
url
,
path
=
folder
,
cache_max_age
=
cache_max_age
)
config
.
add_static_view
(
url
,
path
=
folder
,
cache_max_age
=
cache_max_age
)
def
includeme
(
config
):
def
includeme
(
config
):
config
.
add_translation_dirs
(
'opensipkd.tools:locale/'
)
config
.
add_translation_dirs
(
'opensipkd.tools:locale/'
)
opensipkd/tools/tools.init
0 → 100644
View file @
b0a3cd2
This diff is collapsed.
Click to expand it.
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