py2ls 0.1.7.1__py3-none-any.whl → 0.1.7.2__py3-none-any.whl

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.
py2ls/netfinder.py CHANGED
@@ -1062,37 +1062,33 @@ def find_all(url, dir_save=None, driver='req'):
1062
1062
  return df
1063
1063
 
1064
1064
 
1065
- def flist(fpath, filter="all"):
1065
+ def flist(fpath, kind="all"):
1066
1066
  all_files = [os.path.join(fpath, f) for f in os.listdir(fpath) if os.path.isfile(os.path.join(fpath, f))]
1067
- if isinstance(filter, str):
1068
- filter=[filter]
1069
- if isinstance(filter, list):
1070
- filt_files=[]
1071
- for filter_ in filter:
1072
- filt_files.extend(flist(fpath, filter_))
1073
- return filt_files
1074
- else:
1075
- if 'all' in filter.lower():
1076
- return all_files
1077
- else:
1078
- filt_files = [f for f in all_files if istype(f, filter)]
1079
- return filt_files
1067
+ if filter == "all" or 'all' in filter:
1068
+ return all_files
1069
+ if isinstance(kind, str):
1070
+ kind=[kind]
1071
+ filt_files=[]
1072
+ for kind_ in kind:
1073
+ if isa(f, kind_):
1074
+ filt_files.extend(flist(fpath, kind_))
1075
+ return filt_files
1080
1076
 
1081
- def istype(fpath, filter='img'):
1077
+ def isa(fpath, kind='img'):
1082
1078
  """
1083
- Filters file paths based on the specified filter.
1079
+ kinds file paths based on the specified kind.
1084
1080
  Args:
1085
1081
  fpath (str): Path to the file.
1086
- filter (str): filter of file to filter. Default is 'img' for images. Other options include 'doc' for documents,
1082
+ kind (str): kind of file to kind. Default is 'img' for images. Other options include 'doc' for documents,
1087
1083
  'zip' for ZIP archives, and 'other' for other types of files.
1088
1084
  Returns:
1089
- bool: True if the file matches the filter, False otherwise.
1085
+ bool: True if the file matches the kind, False otherwise.
1090
1086
  """
1091
- if 'img' in filter.lower():
1087
+ if 'img' in kind.lower():
1092
1088
  return is_image(fpath)
1093
- elif 'doc' in filter.lower():
1089
+ elif 'doc' in kind.lower():
1094
1090
  return is_document(fpath)
1095
- elif 'zip' in filter.lower():
1091
+ elif 'zip' in kind.lower():
1096
1092
  return is_zip(fpath)
1097
1093
  else:
1098
1094
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2ls
3
- Version: 0.1.7.1
3
+ Version: 0.1.7.2
4
4
  Summary: py(thon)2(too)ls
5
5
  Author: Jianfeng
6
6
  Author-email: Jianfeng.Liu0413@gmail.com
@@ -135,13 +135,13 @@ py2ls/doc.py,sha256=xN3g1OWfoaGUhikbJ0NqbN5eKy1VZVvWwRlhHMgyVEc,4243
135
135
  py2ls/export_requirements.py,sha256=x2WgUF0jYKz9GfA1MVKN-MdsM-oQ8yUeC6Ua8oCymio,2325
136
136
  py2ls/freqanalysis.py,sha256=F4218VSPbgL5tnngh6xNCYuNnfR-F_QjECUUxrPYZss,32594
137
137
  py2ls/ips.py,sha256=KkrkGAF0VQ-N0rH4FQFLyP-C-skY6EPpeO8t_5RngWw,88519
138
- py2ls/netfinder.py,sha256=mgdg4c_4N7LdGJc2mhzQjo9Hcs9hBWg22Legv668jY4,47278
138
+ py2ls/netfinder.py,sha256=ICl1P-M6DqZvnk5p3-ilMTb0nqy7BZwR0MvHctH5a0I,47107
139
139
  py2ls/plot.py,sha256=8_33-1wpkGZrDUuvRBfTPUi_BRKdf1njoR725OLSLSY,48579
140
140
  py2ls/setuptools-70.1.0-py3-none-any.whl,sha256=2bi3cUVal8ip86s0SOvgspteEF8SKLukECi-EWmFomc,882588
141
141
  py2ls/sleep_events_detectors.py,sha256=36MCuRrpurn0Uvzpo3p3b3_JlVsRNHSWCXbJxCGM3mg,51546
142
142
  py2ls/stats.py,sha256=Wd9yCKQ_61QD29WMEgMuEcreFxF91NmlPW65iWT2B5w,39041
143
143
  py2ls/translator.py,sha256=bc5FB-wqC4TtQz9gyCP1mE38HqNRJ_pmuRIgKnAlMzM,30581
144
144
  py2ls/wb_detector.py,sha256=7y6TmBUj9exCZeIgBAJ_9hwuhkDh1x_-yg4dvNY1_GQ,6284
145
- py2ls-0.1.7.1.dist-info/METADATA,sha256=08eIRuuZsqKyVtM83JK6VIkOXZJY-MAxTjtA0s4YcDE,20017
146
- py2ls-0.1.7.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
147
- py2ls-0.1.7.1.dist-info/RECORD,,
145
+ py2ls-0.1.7.2.dist-info/METADATA,sha256=JiktiXLdDiAU9bWCgp-uhidcaMn_isg-JEAkiNjR_uA,20017
146
+ py2ls-0.1.7.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
147
+ py2ls-0.1.7.2.dist-info/RECORD,,