INNER CODE UNIT · Python
extract_plain_name
MOLAorg/mola · scripts/generate_statuses_table.py:16
def extract_plain_name(directory):
# Extract the plain name without the full path
return os.path.basename(directory)
def process_directories(path, items_to_remove, pattern_text):
directories = list_directories(path)
sorted_directories = sorted(directories, key=extract_plain_name)
for plain_name in sorted_directories:
# Check if the plain name passes the filter
if plain_name not in items_to_remove:
# Print the pattern text with the name
output_text = pattern_text.format(name=plain_name)
print(output_text)