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.
Files changed (29) hide show
  1. {upplib-3.1.8 → upplib-3.2.0}/PKG-INFO +1 -1
  2. {upplib-3.1.8 → upplib-3.2.0}/upplib/__init__.py +1 -0
  3. {upplib-3.1.8 → upplib-3.2.0}/upplib/file_text.py +13 -2
  4. {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/PKG-INFO +1 -1
  5. {upplib-3.1.8 → upplib-3.2.0}/LICENSE +0 -0
  6. {upplib-3.1.8 → upplib-3.2.0}/README.md +0 -0
  7. {upplib-3.1.8 → upplib-3.2.0}/pyproject.toml +0 -0
  8. {upplib-3.1.8 → upplib-3.2.0}/setup.cfg +0 -0
  9. {upplib-3.1.8 → upplib-3.2.0}/setup.py +0 -0
  10. {upplib-3.1.8 → upplib-3.2.0}/upplib/chart.py +0 -0
  11. {upplib-3.1.8 → upplib-3.2.0}/upplib/chart_html.py +0 -0
  12. {upplib-3.1.8 → upplib-3.2.0}/upplib/clean_up_msg.py +0 -0
  13. {upplib-3.1.8 → upplib-3.2.0}/upplib/common_package.py +0 -0
  14. {upplib-3.1.8 → upplib-3.2.0}/upplib/db.py +0 -0
  15. {upplib-3.1.8 → upplib-3.2.0}/upplib/file.py +0 -0
  16. {upplib-3.1.8 → upplib-3.2.0}/upplib/format_data.py +0 -0
  17. {upplib-3.1.8 → upplib-3.2.0}/upplib/http_util.py +0 -0
  18. {upplib-3.1.8 → upplib-3.2.0}/upplib/index.py +0 -0
  19. {upplib-3.1.8 → upplib-3.2.0}/upplib/mail.py +0 -0
  20. {upplib-3.1.8 → upplib-3.2.0}/upplib/mail_html.py +0 -0
  21. {upplib-3.1.8 → upplib-3.2.0}/upplib/markdown.py +0 -0
  22. {upplib-3.1.8 → upplib-3.2.0}/upplib/multi_thread.py +0 -0
  23. {upplib-3.1.8 → upplib-3.2.0}/upplib/query_log.py +0 -0
  24. {upplib-3.1.8 → upplib-3.2.0}/upplib/redis_tool.py +0 -0
  25. {upplib-3.1.8 → upplib-3.2.0}/upplib/util.py +0 -0
  26. {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/SOURCES.txt +0 -0
  27. {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/dependency_links.txt +0 -0
  28. {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/requires.txt +0 -0
  29. {upplib-3.1.8 → upplib-3.2.0}/upplib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: upplib
3
- Version: 3.1.8
3
+ Version: 3.2.0
4
4
  Summary: util
5
5
  Author: Luck
6
6
  Author-email: wantwaterfish@gmail.com
@@ -8,6 +8,7 @@ from upplib.util import *
8
8
 
9
9
  # 有关文件操作类的包
10
10
  from upplib.file import *
11
+ from upplib.file_text import *
11
12
 
12
13
  # 有关 图表的 html 代码的包
13
14
  from upplib.chart_html import *
@@ -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 | None = None,
587
- ignore_end_with: list | int | str | None = None,
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: upplib
3
- Version: 3.1.8
3
+ Version: 3.2.0
4
4
  Summary: util
5
5
  Author: Luck
6
6
  Author-email: wantwaterfish@gmail.com
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