TK-IT / web

TÅGEKAMMERETs hjemmeside i Django. Både offentlig og intern
https://TAAGEKAMMERET.dk
Other
1 stars 3 forks source link

Remove __future__ imports and encoding comments #186

Closed Mortal closed 6 years ago

Mortal commented 6 years ago

Performed automatically using the following commands:

2to3 -f future -w `git ls-tree --name-only -r @|grep 'py$'`
sed -i -e '/coding: utf-?8/ d' `git ls-tree --name-only -r @|grep 'py$'`

... and the following script:

import subprocess

for line in subprocess.check_output('git status -s', shell=True, universal_newlines=True).splitlines():
    if not line.startswith(' M '):
        continue
    filename = line[3:]
    with open(filename) as fp:
        first = fp.readline()
        if first != '\n':
            continue
        contents = fp.read()
    with open(filename, 'w') as fp:
        fp.write(contents.lstrip())