Skip to content

Commit

Permalink
📝 Updates Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-github committed Mar 2, 2023
1 parent b0d0744 commit 22c93a5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "notion-nlp"
version = "1.0.7.2"
version = "1.0.7.3"
description = "Reading rich text information from a Notion database and performing simple NLP analysis."
authors = ["Dario Zhang <[email protected]>"]
license = "MIT license"
Expand Down
23 changes: 15 additions & 8 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
#!/bin/bash

# dir name
dir=$(basename $(dirname $0))
# Get current working directory with full path
fullPath=$(pwd)

# Get only directory name without path
dirNameOrigin=$(basename $fullPath)
dirName=${dirNameOrigin//-/_}
echo $dirName
# pypi token
pypi_token=$(cat PYPI_TOKEN)

# 从__init__.py文件中读取版本信息
version=$(python -c "from src.$dir import __version__; print(__version__)")
version=$(python -c "from src.$dirName import __version__; print(__version__)")
echo $version

# build & publish
poetry build && \
poetry publish -u __token__ -p $pypi_token
/usr/bin/python3.8 -m poetry build && \
/usr/bin/python3.8 -m poetry publish -u __token__ -p $pypi_token

# pyinstaller linux exec file
pyinstaller -F src/$dir/__main__.py -n $dir-linux && \
/usr/bin/python3.8 -m poetry run pyinstaller -F src/$dirName/__main__.py -n $dirNameOrigin-linux && \

# Compress the executable file
zip ./dist/$dir-linux.zip ./dist/$dir-linux ./scripts/Chinese-simple.sh scripts/English.sh scripts/start.sh
zip -j ./dist/$dirNameOrigin-$version-linux.zip ./dist/$dirNameOrigin-linux ./scripts/Chinese-simple.sh scripts/English.sh scripts/start.sh

zip dist/$dir-win64.zip dist/$dir-win64.exe scripts/Chinese-simple.bat scripts/English.bat scripts/start.bat
zip -j ./dist/$dirNameOrigin-$version-win64.zip ./dist/$dirNameOrigin-win64.exe scripts/Chinese-simple.bat scripts/English.bat scripts/start.bat

# todo 把停用词也更新了
2 changes: 1 addition & 1 deletion scripts/Chinese-simple.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ color 0a
echo ================== ☆ Notion 自然语言处理 ☆ ======================
echo=
echo 作者: Dario Zhang
echo 版本: v1.0.7.2
echo 版本: v1.0.7.3
echo 代码: https://github.com/dario-github/notion-nlp
echo 描述: 从Notion数据库中读取文本并进行自然语言处理分析
echo=
Expand Down
2 changes: 1 addition & 1 deletion scripts/English.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ color 0a
echo ============ Notion Natural Language Processing =================
echo=
echo Author: Dario Zhang
echo Version: v1.0.7.2
echo Version: v1.0.7.3
echo Code: https://github.com/dario-github/notion-nlp
echo Description: Read text from the Notion database and perform natural
echo language processing analysis
Expand Down
2 changes: 1 addition & 1 deletion src/notion_nlp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.7.2"
__version__ = "1.0.7.3"
from . import core, parameter
from .core.task import first_try, run_all_tasks, run_task, task_info
from .parameter import log
8 changes: 4 additions & 4 deletions src/notion_nlp/core/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def task_info(
"""查看任务信息
Args:
config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml".
config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml".
"""
config = load_config(config_file)
if not config.tasks_with_diff_name():
Expand Down Expand Up @@ -110,9 +110,9 @@ def run_task(
task (TaskParams, optional): 任务信息参数类. Defaults to None.
task_json (str, optional): 任务信息json字符串. Defaults to None.
task_name (str, optional): 任务名. Defaults to None.
config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml".
config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml".
download_stopwords (bool, optional): 是否下载停用词. Defaults to False.
stopfiles_dir (str, optional): 停用词文件目录. Defaults to "notion_nlp/stopwords".
stopfiles_dir (str, optional): 停用词文件目录. Defaults to "notion-nlp-dataset/stopwords".
stopfiles_postfix (str, optional): 停用词文件后缀. Defaults to "stopwords.txt".
Raises:
Expand Down Expand Up @@ -181,7 +181,7 @@ def run_all_tasks(
"""运行所有任务
Args:
config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml".
config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml".
"""
# 打印所有任务信息
task_info(config_file)
Expand Down
2 changes: 1 addition & 1 deletion src/notion_nlp/core/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def word_cloud_plot(
font_path: Optional[str] = None,
width: int = 800, # TODO 词云图的宽、高也放到task参数中(作为可选项)
height: int = 450,
colormap: str = "viridis", # TODO 词云图的颜色也是可选项,可以指定自己想要的颜色
colormap: str = "viridis",
font_show: str = "chinese.stzhongs.ttf",
):
"""绘制词云图
Expand Down

0 comments on commit 22c93a5

Please sign in to comment.