Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
R
robo-dividend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenwen.tang
robo-dividend
Commits
d2b45597
Commit
d2b45597
authored
Oct 31, 2022
by
纪超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成日志、配置文件、数据库工具模块
parent
294dd165
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
6 deletions
+4
-6
__init__.py
dao/__init__.py
+1
-0
fund_info.py
dao/fund_info.py
+0
-0
__init__.py
fund_pool/__init__.py
+0
-0
__env_config.py
utils/__env_config.py
+1
-1
datebase.py
utils/datebase.py
+2
-5
No files found.
dao/__init__.py
0 → 100644
View file @
d2b45597
from
.
import
*
dao/fund_info.py
0 → 100644
View file @
d2b45597
fund_pool/__init__.py
0 → 100644
View file @
d2b45597
utils/__env_config.py
View file @
d2b45597
...
...
@@ -74,7 +74,7 @@ def env_var_constructor(loader, node, raw=False):
def
get_config
(
config_name
=
None
):
CONFIG_NAME
=
config_name
or
'config.yml'
path
=
f
'{get_project_path()}{os.path.sep}
config.yml
'
path
=
f
'{get_project_path()}{os.path.sep}
{CONFIG_NAME}
'
with
open
(
path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
return
yaml
.
safe_load
(
f
)
...
...
utils/datebase.py
View file @
d2b45597
...
...
@@ -3,7 +3,6 @@ import pymysql
import
threading
from
pymysql.cursors
import
DictCursor
from
.__env_config
import
config
as
default_config
from
functools
import
partial
class
Database
:
...
...
@@ -60,7 +59,7 @@ def read(func=None, config=None, one=False):
def
write
(
func
=
None
,
config
=
None
):
if
func
is
None
:
return
functools
.
partial
(
write
,
func
=
func
,
config
=
config
)
return
functools
.
partial
(
write
,
config
=
config
)
def
execute
(
db
,
sqls
):
if
isinstance
(
sqls
,
list
):
...
...
@@ -87,7 +86,7 @@ def write(func=None, config=None):
def
transaction
(
func
=
None
,
config
=
None
):
if
func
is
None
:
return
functools
.
partial
(
transaction
,
func
=
func
,
config
=
config
)
return
functools
.
partial
(
transaction
,
config
=
config
)
@
functools
.
wraps
(
func
)
def
wraps
(
*
args
,
**
kwargs
):
...
...
@@ -105,5 +104,3 @@ def transaction(func=None, config=None):
finally
:
del
__local__
.
db
return
wraps
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment