upplib 3.1.8__tar.gz → 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {upplib-3.1.8 → upplib-3.2.0}/PKG-INFO +1 -1
- {upplib-3.1.8 → upplib-3.2.0}/upplib/__init__.py +1 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/file_text.py +13 -2
- {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/PKG-INFO +1 -1
- {upplib-3.1.8 → upplib-3.2.0}/LICENSE +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/README.md +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/pyproject.toml +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/setup.cfg +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/setup.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/chart.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/chart_html.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/clean_up_msg.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/common_package.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/db.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/file.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/format_data.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/http_util.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/index.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/mail.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/mail_html.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/markdown.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/multi_thread.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/query_log.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/redis_tool.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib/util.py +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/SOURCES.txt +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/dependency_links.txt +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/requires.txt +0 -0
- {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/top_level.txt +0 -0
|
@@ -583,8 +583,8 @@ def to_list_from_txt(file_name: str = 'a.txt',
|
|
|
583
583
|
sep_line_with_space_count: int = None,
|
|
584
584
|
sep_is_front: bool = True,
|
|
585
585
|
sep_all: str = None,
|
|
586
|
-
ignore_start_with: list | int | str
|
|
587
|
-
ignore_end_with: list | int | str
|
|
586
|
+
ignore_start_with: list | int | str = None,
|
|
587
|
+
ignore_end_with: list | int | str = None,
|
|
588
588
|
ignore_empty: bool | None = None,
|
|
589
589
|
line_join: str = None,
|
|
590
590
|
line_must_start_with: str = None,
|
|
@@ -612,6 +612,8 @@ def to_list_from_txt(file_name: str = 'a.txt',
|
|
|
612
612
|
ignore_start_with : 忽略以这个为开头的行
|
|
613
613
|
ignore_end_with : 忽略以这个为结尾的行
|
|
614
614
|
ignore_empty : 如果这一行为空,就忽略这行
|
|
615
|
+
line_must_start_with : 这一行必须以这个字符串为开始
|
|
616
|
+
line_must_contain : 这一行必须包含这个字符串
|
|
615
617
|
line_join : 将 list(list(str)) 转化成 list(str) 类型的数据
|
|
616
618
|
line_json : 将 list(str) 转化成 list(json) 类型的数据, 会自动过滤掉空格行
|
|
617
619
|
start_index : 从这个地方开始读取,从1开始标号 , 包含这一行
|
|
@@ -679,8 +681,17 @@ def to_list_from_txt(file_name: str = 'a.txt',
|
|
|
679
681
|
if line.endswith(str(ignore_end_with)):
|
|
680
682
|
can_add = False
|
|
681
683
|
if ignore_empty is not None and ignore_empty:
|
|
684
|
+
# 忽略空行
|
|
682
685
|
if len(line) == 0:
|
|
683
686
|
can_add = False
|
|
687
|
+
if line_must_start_with is not None:
|
|
688
|
+
# 必须以这个字符串为开始
|
|
689
|
+
if not line.startswith(str(line_must_start_with)):
|
|
690
|
+
can_add = False
|
|
691
|
+
if line_must_contain is not None:
|
|
692
|
+
# 必须包含这个字符串
|
|
693
|
+
if line.count(str(line_must_contain)) == 0:
|
|
694
|
+
can_add = False
|
|
684
695
|
if can_add:
|
|
685
696
|
data_list.append(line)
|
|
686
697
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|