To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit bf134731 authored by vermeul's avatar vermeul
Browse files

Update 07-Built-in_Functions.md

parent e3a94fce
......@@ -91,7 +91,7 @@ import os
import re
def my_sort(val, coll):
def my_sort(coll):
def my_coll_sort(val):
match = re.search('\d+_Ms_{}_(?P<page>\d+)'.format(coll), val)
if match:
......@@ -100,7 +100,7 @@ def my_sort(val, coll):
return 0
return my_coll_sort
def my_filter(val, coll):
def my_filter(coll):
def my_coll_filter(val):
match = re.search(r'^\d+_Ms_{}.*?xml$'.format(coll), val)
return match
......@@ -112,8 +112,8 @@ collection = '229'
path = os.path.join('/Users/vermeul/semper-tei', collection)
for root, dirs, files in os.walk(path):
for filename in sorted(
filter( my_filter(val=filename, coll=collection), files),
key=my_sort(val=filename, coll=collection)
filter( my_filter(coll=collection), files),
key=my_sort(coll=collection)
):
print(filename)
```
......
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