Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
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 08d19707
authored
Jun 04, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
penghapusan get_file
1 parent
6ddf0faa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
opensipkd/base/__init__.py
opensipkd/base/__init__.py
View file @
08d1970
...
@@ -736,10 +736,10 @@ def main(global_config, **settings):
...
@@ -736,10 +736,10 @@ def main(global_config, **settings):
return
config
.
make_wsgi_app
()
return
config
.
make_wsgi_app
()
def
get_route_file
(
filename
):
#
def get_route_file(filename):
base_dir
=
os
.
path
.
split
(
__file__
)[
0
]
#
base_dir = os.path.split(__file__)[0]
fullpath
=
os
.
path
.
join
(
base_dir
,
'scripts'
,
'data'
,
filename
)
#
fullpath = os.path.join(base_dir, 'scripts', 'data', filename)
return
open
(
fullpath
)
#
return open(fullpath)
def
routes_by_array
(
config
,
routs
):
def
routes_by_array
(
config
,
routs
):
...
@@ -749,6 +749,12 @@ def routes_by_array(config, routs):
...
@@ -749,6 +749,12 @@ def routes_by_array(config, routs):
class
BaseApp
():
class
BaseApp
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
menus
=
[]
self
.
menus
=
[]
self
.
base_dir
=
os
.
path
.
split
(
__file__
)[
0
]
def
get_route_file
(
self
,
filename
=
"routes.csv"
):
fullpath
=
os
.
path
.
join
(
self
.
base_dir
,
'scripts'
,
'data'
,
filename
)
return
open
(
fullpath
)
def
add_menu
(
self
,
config
,
route_menus
,
parent
=
None
,
paket
=
"opensipkd.base.views"
):
def
add_menu
(
self
,
config
,
route_menus
,
parent
=
None
,
paket
=
"opensipkd.base.views"
):
...
@@ -816,7 +822,10 @@ class BaseApp():
...
@@ -816,7 +822,10 @@ class BaseApp():
self
.
route_children
(
p
[
"children"
],
row
)
self
.
route_children
(
p
[
"children"
],
row
)
def
route_from_csv
(
self
,
config
,
get_file
=
get_route_file
,
paket
=
"opensipkd.base.views"
):
def
route_from_csv
(
self
,
config
,
get_file
=
get_route_file
,
paket
=
"opensipkd.base.views"
):
with
get_file
(
"routes.csv"
)
as
f
:
"""
Get File tidak digunakan lagi
"""
with
self
.
get_route_file
(
"routes.csv"
)
as
f
:
rows
=
csv
.
DictReader
(
f
)
rows
=
csv
.
DictReader
(
f
)
new_routes
=
[]
new_routes
=
[]
for
row
in
rows
:
for
row
in
rows
:
...
...
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