forked from Booritas/slideio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-profile.py
36 lines (28 loc) · 992 Bytes
/
create-profile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
unique_lines = set()
def extract_lines(file_path):
requires_found = False
options_found = False
with open(file_path, 'r') as file:
for line in file:
if line.strip() == '[requires]':
requires_found = True
continue
elif line.strip() == '[options]':
options_found = True
break
if requires_found and not options_found:
unique_lines.add(line.strip())
def process_files(directory):
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('conanfile.txt'):
file_path = os.path.join(root, file)
extract_lines(file_path)
# Change the current directory to the desired directory
os.chdir('d:/Projects/slideio/slideio')
# Call the function to process the files
process_files('.')
print(f'------------------------------------')
for line in unique_lines:
print(line)