diff options
author | Philipp Hagemeister <[email protected]> | 2014-11-26 20:01:20 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2014-11-26 20:01:22 +0100 |
commit | dcddc10a5032996474e157946b00b8df039eebda (patch) | |
tree | c0203ee3349bcae04bab970657e391f4fc255736 /devscripts/gh-pages | |
parent | a1008af412f51aac82c121eaed07f742055d010b (diff) | |
download | youtube-dl-dcddc10a5032996474e157946b00b8df039eebda.tar.gz youtube-dl-dcddc10a5032996474e157946b00b8df039eebda.zip |
[test_unicode_literals] Arm unicode_literals check
From now on, the line
from __future__ import unicode_literals
should be contained in every single Python file lest we run into any more 2.x/3.x issues.
Going forward, we're likely to develop on 3.x only and would likely miss subtle bugs otherwise.
Diffstat (limited to 'devscripts/gh-pages')
-rwxr-xr-x | devscripts/gh-pages/add-version.py | 1 | ||||
-rwxr-xr-x | devscripts/gh-pages/generate-download.py | 2 | ||||
-rwxr-xr-x | devscripts/gh-pages/sign-versions.py | 4 | ||||
-rwxr-xr-x | devscripts/gh-pages/update-copyright.py | 4 | ||||
-rwxr-xr-x | devscripts/gh-pages/update-feed.py | 1 | ||||
-rwxr-xr-x | devscripts/gh-pages/update-sites.py | 1 |
6 files changed, 10 insertions, 3 deletions
diff --git a/devscripts/gh-pages/add-version.py b/devscripts/gh-pages/add-version.py index 35865b2f3..867ea0048 100755 --- a/devscripts/gh-pages/add-version.py +++ b/devscripts/gh-pages/add-version.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from __future__ import unicode_literals import json import sys diff --git a/devscripts/gh-pages/generate-download.py b/devscripts/gh-pages/generate-download.py index e90c787fd..392e3ba21 100755 --- a/devscripts/gh-pages/generate-download.py +++ b/devscripts/gh-pages/generate-download.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +from __future__ import unicode_literals + import hashlib import urllib.request import json diff --git a/devscripts/gh-pages/sign-versions.py b/devscripts/gh-pages/sign-versions.py index 953a5162e..fa389c358 100755 --- a/devscripts/gh-pages/sign-versions.py +++ b/devscripts/gh-pages/sign-versions.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from __future__ import unicode_literals, with_statement import rsa import json @@ -29,4 +30,5 @@ signature = hexlify(rsa.pkcs1.sign(json.dumps(versions_info, sort_keys=True).enc print('signature: ' + signature) versions_info['signature'] = signature -json.dump(versions_info, open('update/versions.json', 'w'), indent=4, sort_keys=True) +with open('update/versions.json', 'w') as versionsf: + json.dump(versions_info, versionsf, indent=4, sort_keys=True) diff --git a/devscripts/gh-pages/update-copyright.py b/devscripts/gh-pages/update-copyright.py index 5bc5c6514..3663c8afe 100755 --- a/devscripts/gh-pages/update-copyright.py +++ b/devscripts/gh-pages/update-copyright.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -from __future__ import with_statement +from __future__ import with_statement, unicode_literals import datetime import glob @@ -13,7 +13,7 @@ year = str(datetime.datetime.now().year) for fn in glob.glob('*.html*'): with io.open(fn, encoding='utf-8') as f: content = f.read() - newc = re.sub(u'(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', u'Copyright © 2006-' + year, content) + newc = re.sub(r'(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', 'Copyright © 2006-' + year, content) if content != newc: tmpFn = fn + '.part' with io.open(tmpFn, 'wt', encoding='utf-8') as outf: diff --git a/devscripts/gh-pages/update-feed.py b/devscripts/gh-pages/update-feed.py index 46373a8db..e93eb60fb 100755 --- a/devscripts/gh-pages/update-feed.py +++ b/devscripts/gh-pages/update-feed.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from __future__ import unicode_literals import datetime import io diff --git a/devscripts/gh-pages/update-sites.py b/devscripts/gh-pages/update-sites.py index 4a6bb5e35..f0f0481c7 100755 --- a/devscripts/gh-pages/update-sites.py +++ b/devscripts/gh-pages/update-sites.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from __future__ import unicode_literals import sys import os |