Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LAPTOP-7V78BBO2\ydf19 committed Jan 7, 2022
1 parent 70b2740 commit 82ef9fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nb_log/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nb_log.monkey_print import nb_print, patch_print, reverse_patch_print,stdout_write,stderr_write,print_raw,is_main_process,only_print_on_main_process
from nb_log.log_manager import LogManager, LoggerLevelSetterMixin, LoggerMixin, LoggerMixinDefaultWithFileHandler, get_logger, get_logger_with_filehanlder

if nb_log_config_default.WARNING_PYCHARM_COLOR_SETINGS:
if nb_log_config_default.SHOW_PYCHARM_COLOR_SETINGS:
only_print_on_main_process(
"""
1)使用pycharm时候,强烈建议按下面的重新自定义设置pycharm的console里面的主题颜色,否则颜色显示瞎眼,代码里面规定的颜色只是大概的红黄蓝绿。在不同的ide软件和主题、字体下是不同的显示效果,需要用户自己设置。
Expand Down
6 changes: 4 additions & 2 deletions nb_log/set_nb_log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def auto_creat_config_file_to_project_root_path():
"""
:return:
"""
if Path(sys.path[1]).as_posix() in Path(__file__).parent.parent.absolute().as_posix():
if Path(sys.path[1]).as_posix() == Path(__file__).parent.parent.absolute().as_posix():
pass
nb_print('不希望在本项目里面创建')
nb_print('不希望在本项目 sys.path[1] 里面创建 nb_log_config.py')
return
# noinspection PyPep8
"""
Expand All @@ -99,6 +99,8 @@ def auto_creat_config_file_to_project_root_path():
要是连PYTHONPATH这个知识点都不知道,那就要google 百度去学习PYTHONPATH作用了,非常重要非常好用,
不知道PYTHONPATH作用的人,在深层级文件夹作为运行起点导入外层目录的包的时候,如果把深层级文件作为python的执行文件起点,经常需要到处很low的手写 sys.path.insert硬编码,这种方式写代码太low了。
知道PYTHONPATH的人无论项目有多少层级的文件夹,无论是多深层级文件夹导入外层文件夹,代码里面永久都不需要出现手动硬编码操纵sys.path.append
懂PYTHONPATH 的重要性和妙用见: https://github.com/ydf0509/pythonpathdemo
''')
# with (Path(sys.path[1]) / Path('nb_log_config.py')).open(mode='w', encoding='utf8') as f:
# f.write(config_file_content)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
'flask',
'python-json-logger==0.1.10',
'nb_filelock',
'service-identity'
]

if os.name == 'nt':
install_requires.append('pywin32')

setup(
name='nb_log', #
version="6.8",
version="7.1",
description=(
'very sharp color display,monkey patch bulitin print and high-performance multiprocess safe roating file handler,other handlers includeing dintalk ,email,kafka,elastic and so on '
),
Expand Down Expand Up @@ -65,7 +66,7 @@
python setup.py sdist & twine upload dist/nb_log-6.0.tar.gz
python setup.py sdist & python -m twine upload dist/nb_log-6.8.tar.gz
python setup.py sdist ; python -m twine upload dist/nb_log-7.1.tar.gz
twine upload dist/*
Expand Down

0 comments on commit 82ef9fa

Please sign in to comment.