Commit 6a47fee2 authored by Recolic Keghart's avatar Recolic Keghart 🎱

adjust

parent 3b63731e
...@@ -33,7 +33,7 @@ def main(): ...@@ -33,7 +33,7 @@ def main():
target_id = utils.get_id_prefix_from_string(target_filename) target_id = utils.get_id_prefix_from_string(target_filename)
results = [] results = []
print('Iterating... Please wait...') print('Iterating... Please wait... (searching for', target_id)
is_xlsx = lambda fname: fname.endswith('.xlsm') or fname.endswith('.xlsx') or fname.endswith('.xls') or fname.endswith('.XLSM') or fname.endswith('.XLSX') or fname.endswith('.XLS') is_xlsx = lambda fname: fname.endswith('.xlsm') or fname.endswith('.xlsx') or fname.endswith('.xls') or fname.endswith('.XLSM') or fname.endswith('.XLSX') or fname.endswith('.XLS')
for (dirpath, dirnames, filenames) in os.walk(config.library_path): for (dirpath, dirnames, filenames) in os.walk(config.library_path):
for fname in filenames: for fname in filenames:
...@@ -47,6 +47,8 @@ def main(): ...@@ -47,6 +47,8 @@ def main():
os.chdir(config.working_dir) os.chdir(config.working_dir)
print(results) print(results)
with open(target_id + '被引用处.csv', 'w+') as f: with open(target_id + '被引用处.csv', 'w+') as f:
if len(results) == 0:
results = ['找不到任何引用']
f.write(',\n'.join(results)) f.write(',\n'.join(results))
main() main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment