Skip to content

Commit

Permalink
Merge pull request #1 from lyy289065406/feature-1.1.3
Browse files Browse the repository at this point in the history
Feature 1.1.3
  • Loading branch information
lyy289065406 authored Oct 29, 2022
2 parents 7be2d9a + 15d041c commit aa08c60
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ __pycache__/


# log
log/
logs/
*.log


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
#
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['pymysql'], # Optional
install_requires=['pymysql', 'py-color-log'], # Optional

# List additional groups of dependencies here (e.g. development
# dependencies). Users will be able to install these using the "extras"
Expand Down
2 changes: 1 addition & 1 deletion src/pypdm/_pdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import string
from .assist.cfg import *
from .assist.num import *
from .assist import log
from color_log.clog import log


class PDM :
Expand Down
96 changes: 0 additions & 96 deletions src/pypdm/assist/log.py

This file was deleted.

7 changes: 2 additions & 5 deletions src/pypdm/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ def build(
pdm_pkg = 'src.pdm',
table_whitelist = [],
table_blacklist = [],
to_log = False
to_log = True
) :
'''
构造指定数据库的 PDM 对象文件
:param dbc: 数据库连接对象
:param pdm_pkg: 期望生成 PDM 文件的包路径
:param table_whitelist: 要生成哪些表的 PDM 文件(默认所有表)
:param table_blacklist: 不生成哪些表的 PDM 文件
:param to_log: 是否启用内部日志
:param to_log: 是否启用内部日志(此参数在 1.1.3 之后已失效)
:return:
'''
if to_log :
log.init()

paths = []
if dbc :
log.info('正在构造数据表 PDM ...')
Expand Down
2 changes: 1 addition & 1 deletion src/pypdm/dao/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# -------------------------------


from ..assist import log
from ..assist.cfg import *
from color_log.clog import log


class BaseDao:
Expand Down
2 changes: 1 addition & 1 deletion src/pypdm/dbc/_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# Mysql 数据库连接器
# -------------------------------

from color_log.clog import log
import pymysql as pdbc
from ..assist.cfg import *
from ..assist import log


class MysqlDBC :
Expand Down
2 changes: 1 addition & 1 deletion src/pypdm/dbc/_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# -----------------------------------------------

import sqlite3
from color_log.clog import log
from ..assist.cfg import *
from ..assist import log


class SqliteDBC :
Expand Down
1 change: 0 additions & 1 deletion tests/test_pypdm_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../')
# ----------------------------------------------------------------------

import shutil
import unittest
from src.pypdm.assist.cfg import *
from src.pypdm.dbc._mysql import MysqlDBC
Expand Down
1 change: 0 additions & 1 deletion tests/test_pypdm_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../')
# ----------------------------------------------------------------------

import shutil
import unittest
from src.pypdm.assist.cfg import *
from src.pypdm.dbc._sqlite import SqliteDBC
Expand Down

0 comments on commit aa08c60

Please sign in to comment.