Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
tangsel-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ee2fa459
authored
May 27, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
oracle
1 parent
cea94751
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
development.ini
tangsel/pbb/monitoring/__init__.py
tangsel/pbb/monitoring/scripts/initializedb.py
development.ini
View file @
ee2fa45
...
@@ -63,7 +63,7 @@ mail.password = ajmyoksxeiprmtyc
...
@@ -63,7 +63,7 @@ mail.password = ajmyoksxeiprmtyc
mail.sender_name
=
"tangsel"
mail.sender_name
=
"tangsel"
;PBB
;PBB
pbb.url
=
oracle://PBB:A@10.8.50.62/simpbb
pbb.url
=
oracle
+oracledb
://PBB:A@10.8.50.62/simpbb
pbbm.url
=
pbbm.url
=
lib_dir
=
C:
\U
sers
\a
agus
\P
roject
\p
bb
\i
nstantclient_11_2
lib_dir
=
C:
\U
sers
\a
agus
\P
roject
\p
bb
\i
nstantclient_11_2
pbb_esppt_files
=
C:
\t
mp
\p
bb_esppt_files
pbb_esppt_files
=
C:
\t
mp
\p
bb_esppt_files
...
...
tangsel/pbb/monitoring/__init__.py
View file @
ee2fa45
...
@@ -120,13 +120,20 @@ def includeme(config):
...
@@ -120,13 +120,20 @@ def includeme(config):
cache_max_age
=
3600
)
cache_max_age
=
3600
)
try
:
try
:
if
"lib_dir"
in
settings
and
settings
[
"lib_dir"
]:
if
"lib_dir"
in
settings
and
settings
[
"lib_dir"
]:
import
cx_Oracle
try
:
from
cx_Oracle
import
init_oracle_client
except
:
from
oracledb
import
init_oracle_client
lib_dir
=
rf
"{settings['lib_dir']}"
lib_dir
=
rf
"{settings['lib_dir']}"
cx_Oracle
.
init_oracle_client
(
lib_dir
=
lib_dir
)
init_oracle_client
(
lib_dir
=
lib_dir
)
except
Exception
as
e
:
except
Exception
as
e
:
log
.
error
(
"Error in cx_Oracle.init_oracle_client:
%
s"
,
e
)
log
.
error
(
"Error in cx_Oracle.init_oracle_client:
%
s"
,
e
)
pass
pass
oracledb
.
init_oracle_client
(
lib_dir
=
ld
)
url
=
'pbbm.url'
in
settings
and
settings
[
'pbbm.url'
]
and
'pbbm.'
or
None
url
=
'pbbm.url'
in
settings
and
settings
[
'pbbm.url'
]
and
'pbbm.'
or
None
if
not
url
:
if
not
url
:
url
=
'pbb.url'
in
settings
and
settings
[
'pbb.url'
]
and
'pbb.'
or
'sqlalchemy.'
url
=
'pbb.url'
in
settings
and
settings
[
'pbb.url'
]
and
'pbb.'
or
'sqlalchemy.'
...
...
tangsel/pbb/monitoring/scripts/initializedb.py
View file @
ee2fa45
...
@@ -51,9 +51,13 @@ def main(argv=sys.argv):
...
@@ -51,9 +51,13 @@ def main(argv=sys.argv):
# alembic_run(config_uri, "alembic_pbbm")
# alembic_run(config_uri, "alembic_pbbm")
reset_sequences
()
reset_sequences
()
if
"lib_dir"
in
settings
and
settings
[
"lib_dir"
]:
if
"lib_dir"
in
settings
and
settings
[
"lib_dir"
]:
try
:
from
cx_Oracle
import
init_oracle_client
except
:
from
oracledb
import
init_oracle_client
lib_dir
=
rf
"{settings['lib_dir']}"
lib_dir
=
rf
"{settings['lib_dir']}"
import
cx_Oracle
init_oracle_client
(
lib_dir
=
lib_dir
)
cx_Oracle
.
init_oracle_client
(
lib_dir
=
lib_dir
)
url
=
'pbbm.url'
in
settings
and
settings
[
'pbbm.url'
]
and
'pbbm.'
or
None
url
=
'pbbm.url'
in
settings
and
settings
[
'pbbm.url'
]
and
'pbbm.'
or
None
if
not
url
:
if
not
url
:
...
@@ -71,7 +75,8 @@ def main(argv=sys.argv):
...
@@ -71,7 +75,8 @@ def main(argv=sys.argv):
print
(
'>>Append Table'
)
print
(
'>>Append Table'
)
# append_csv(Route, 'routes.csv', ['kode'], get_file_func=get_file, update_exist=True)
# append_csv(Route, 'routes.csv', ['kode'], get_file_func=get_file, update_exist=True)
# append_csv(Menus, 'menus.csv', ['kode'], get_file_func=get_file, update_exist=False)
# append_csv(Menus, 'menus.csv', ['kode'], get_file_func=get_file, update_exist=False)
append_csv
(
Group
,
'group.csv'
,
[
'group_name'
],
get_file_func
=
get_file
,
update_exist
=
True
)
append_csv
(
Group
,
'group.csv'
,
[
'group_name'
],
get_file_func
=
get_file
,
update_exist
=
True
)
append_csv
(
Permission
,
'permissions.csv'
,
[
'perm_name'
],
get_file_func
=
get_file
,
append_csv
(
Permission
,
'permissions.csv'
,
[
'perm_name'
],
get_file_func
=
get_file
,
update_exist
=
True
)
update_exist
=
True
)
append_csv
(
GroupPermission
,
'group_permission.csv'
,
[
'group_id'
,
'perm_name'
],
append_csv
(
GroupPermission
,
'group_permission.csv'
,
[
'group_id'
,
'perm_name'
],
...
...
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