upplib 3.1.9__tar.gz → 3.2.1__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.9 → upplib-3.2.1}/PKG-INFO +1 -1
  2. {upplib-3.1.9 → upplib-3.2.1}/upplib/file_text.py +28 -17
  3. {upplib-3.1.9 → upplib-3.2.1}/upplib.egg-info/PKG-INFO +1 -1
  4. {upplib-3.1.9 → upplib-3.2.1}/LICENSE +0 -0
  5. {upplib-3.1.9 → upplib-3.2.1}/README.md +0 -0
  6. {upplib-3.1.9 → upplib-3.2.1}/pyproject.toml +0 -0
  7. {upplib-3.1.9 → upplib-3.2.1}/setup.cfg +0 -0
  8. {upplib-3.1.9 → upplib-3.2.1}/setup.py +0 -0
  9. {upplib-3.1.9 → upplib-3.2.1}/upplib/__init__.py +0 -0
  10. {upplib-3.1.9 → upplib-3.2.1}/upplib/chart.py +0 -0
  11. {upplib-3.1.9 → upplib-3.2.1}/upplib/chart_html.py +0 -0
  12. {upplib-3.1.9 → upplib-3.2.1}/upplib/clean_up_msg.py +0 -0
  13. {upplib-3.1.9 → upplib-3.2.1}/upplib/common_package.py +0 -0
  14. {upplib-3.1.9 → upplib-3.2.1}/upplib/db.py +0 -0
  15. {upplib-3.1.9 → upplib-3.2.1}/upplib/file.py +0 -0
  16. {upplib-3.1.9 → upplib-3.2.1}/upplib/format_data.py +0 -0
  17. {upplib-3.1.9 → upplib-3.2.1}/upplib/http_util.py +0 -0
  18. {upplib-3.1.9 → upplib-3.2.1}/upplib/index.py +0 -0
  19. {upplib-3.1.9 → upplib-3.2.1}/upplib/mail.py +0 -0
  20. {upplib-3.1.9 → upplib-3.2.1}/upplib/mail_html.py +0 -0
  21. {upplib-3.1.9 → upplib-3.2.1}/upplib/markdown.py +0 -0
  22. {upplib-3.1.9 → upplib-3.2.1}/upplib/multi_thread.py +0 -0
  23. {upplib-3.1.9 → upplib-3.2.1}/upplib/query_log.py +0 -0
  24. {upplib-3.1.9 → upplib-3.2.1}/upplib/redis_tool.py +0 -0
  25. {upplib-3.1.9 → upplib-3.2.1}/upplib/util.py +0 -0
  26. {upplib-3.1.9 → upplib-3.2.1}/upplib.egg-info/SOURCES.txt +0 -0
  27. {upplib-3.1.9 → upplib-3.2.1}/upplib.egg-info/dependency_links.txt +0 -0
  28. {upplib-3.1.9 → upplib-3.2.1}/upplib.egg-info/requires.txt +0 -0
  29. {upplib-3.1.9 → upplib-3.2.1}/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.9
3
+ Version: 3.2.1
4
4
  Summary: util
5
5
  Author: Luck
6
6
  Author-email: wantwaterfish@gmail.com
@@ -583,9 +583,9 @@ 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,
588
- ignore_empty: bool | None = None,
586
+ line_ignore_start_with: list | int | str = None,
587
+ line_ignore_end_with: list | int | str = None,
588
+ line_ignore_empty: bool | None = None,
589
589
  line_join: str = None,
590
590
  line_must_start_with: str = None,
591
591
  line_must_contain: str = None,
@@ -609,9 +609,11 @@ def to_list_from_txt(file_name: str = 'a.txt',
609
609
  sep_line_suffix : 这一行是一个分隔符,以这个分隔符作为后缀的, 将 list(str) 转化为 list(list(str))
610
610
  sep_is_front : 这一行,分割行,是包含到前面,还是包含到
611
611
  sep_all : 将文件转化成一个字符串,然后对这个字符串,再次总体分割 将 list(str) 转化为 str , 然后再次转化成 list(str)
612
- ignore_start_with : 忽略以这个为开头的行
613
- ignore_end_with : 忽略以这个为结尾的行
614
- ignore_empty : 如果这一行为空,就忽略这行
612
+ line_ignore_start_with : 忽略以这个为开头的行
613
+ line_ignore_end_with : 忽略以这个为结尾的行
614
+ line_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开始标号 , 包含这一行
@@ -662,25 +664,34 @@ def to_list_from_txt(file_name: str = 'a.txt',
662
664
  continue
663
665
  c += 1
664
666
  can_add = True
665
- if ignore_start_with is not None:
666
- if isinstance(ignore_start_with, list) or isinstance(ignore_start_with, set):
667
- for ss in ignore_start_with:
667
+ if line_ignore_start_with is not None:
668
+ if isinstance(line_ignore_start_with, list) or isinstance(line_ignore_start_with, set):
669
+ for ss in line_ignore_start_with:
668
670
  if line.startswith(str(ss)):
669
671
  can_add = False
670
- elif isinstance(ignore_start_with, str):
671
- if line.startswith(str(ignore_start_with)):
672
+ elif isinstance(line_ignore_start_with, str):
673
+ if line.startswith(str(line_ignore_start_with)):
672
674
  can_add = False
673
- if ignore_end_with is not None:
674
- if isinstance(ignore_end_with, list) or isinstance(ignore_end_with, set):
675
- for ss in ignore_end_with:
675
+ if line_ignore_end_with is not None:
676
+ if isinstance(line_ignore_end_with, list) or isinstance(line_ignore_end_with, set):
677
+ for ss in line_ignore_end_with:
676
678
  if line.endswith(str(ss)):
677
679
  can_add = False
678
- elif isinstance(ignore_end_with, str):
679
- if line.endswith(str(ignore_end_with)):
680
+ elif isinstance(line_ignore_end_with, str):
681
+ if line.endswith(str(line_ignore_end_with)):
680
682
  can_add = False
681
- if ignore_empty is not None and ignore_empty:
683
+ if line_ignore_empty is not None and line_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.9
3
+ Version: 3.2.1
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
File without changes