remove blank entries from srclibs

```python
import glob
import re
import yaml

print(help(yaml.dump))

for f in glob.glob('srclibs/*.yml'):
    with open(f) as fp:
        data = yaml.safe_load(fp)
    write = False
    if 'Prepare' in data:
        prepare = data['Prepare'].strip()
        if not prepare:
            del(data['Prepare'])
            write = True
    if 'Subdir' in data:
        subdir = data['Subdir']
        if not subdir:
            del(data['Subdir'])
            write = True
    if write:
        with open(f, 'w') as fp:
            yaml.dump(data, fp, default_flow_style=False, allow_unicode=True, encoding=None)
        print('\n=========================================\n', f)
        print('Prepare:', prepare)
```
This commit is contained in:
Hans-Christoph Steiner 2020-05-27 18:44:20 +02:00
parent 5cfbcdc552
commit a6097d9552
6 changed files with 0 additions and 58 deletions

View file

@ -1,12 +1,2 @@
# Source details (the only mandatory fields)
RepoType: git
Repo: https://github.com/boatmeme/microsoft-translator-java-api.git
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir:
# Any extra commands to prepare the source library
Prepare: |

View file

@ -1,12 +1,2 @@
# Source details (the only mandatory fields)
RepoType: git
Repo: https://github.com/bcgit/bc-java.git
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir:
# Any extra commands to prepare the source library
Prepare: |

View file

@ -1,12 +1,3 @@
# Source details (the only mandatory fields)
RepoType: svn
Repo: http://little-fluffy-location-library.googlecode.com/svn/trunk/
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir: little-fluffy-location-library/LittleFluffyLocationLibrary
# Any extra commands to prepare the source library
Prepare: |

View file

@ -1,12 +1,2 @@
# Source details (the only mandatory fields)
RepoType: git
Repo: https://github.com/jhy/jsoup.git
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir:
# Any extra commands to prepare the source library
Prepare: |

View file

@ -1,12 +1,2 @@
# Source details (the only mandatory fields)
RepoType: git
Repo: https://github.com/mick88/MSQLite.git
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir:
# Any extra commands to prepare the source library
Prepare: |

View file

@ -1,12 +1,3 @@
# Source details (the only mandatory fields)
RepoType: git
Repo: https://github.com/jgilfelt/SystemBarTint
# Comma-separated list of subdirs to use. The first existing subdirectory
# found between those given will be used. If none is found or provided, the
# root of the repo directory will be used instead.
Subdir: library
# Any extra commands to prepare the source library
Prepare: |