From acff3ca1094609e01e994fc867d75970ef046940 Mon Sep 17 00:00:00 2001 From: Fernando Farfan Date: Mon, 10 Aug 2015 14:30:35 -0600 Subject: Bump Python version to 3 All our license handling scripts should specify python v.3, so we bump the version for the CreativeCommons scripts. [endlessm/eos-sdk#3471] --- licenses/02-organize-cc-files.py | 10 +++++----- licenses/03-cleanup-cc-html-files.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/licenses/02-organize-cc-files.py b/licenses/02-organize-cc-files.py index 54a90a0..cb4099b 100755 --- a/licenses/02-organize-cc-files.py +++ b/licenses/02-organize-cc-files.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import shutil @@ -88,7 +88,7 @@ def copy_license_files(source_dir, target_dir, licenses): # Move legalcode file for license_name source_legalcode_path = source_license_dir + 'legalcode.html' target_legalcode_path = target_legalcode_dir + license_code + '-legalcode.html' - print 'cp ' + source_legalcode_path + ' ' + target_legalcode_path + print('cp ' + source_legalcode_path + ' ' + target_legalcode_path) shutil.copy(source_legalcode_path, target_legalcode_path) # Move deeds for individual languages @@ -98,17 +98,17 @@ def copy_license_files(source_dir, target_dir, licenses): target_deed_path = target_lang_dir + license_code + '.html' # Move deed file for license_name/language - print 'cp ' + source_deed_path + ' ' + target_deed_path + print('cp ' + source_deed_path + ' ' + target_deed_path) shutil.copy(source_deed_path, target_deed_path) # Rename 'en' subdir to default locale 'C' - print 'mv -f ' + target_dir + 'en/ ' + target_dir + 'C/' + print('mv -f ' + target_dir + 'en/ ' + target_dir + 'C/') shutil.rmtree(target_dir + 'C', ignore_errors=True) shutil.move(target_dir + 'en', target_dir + 'C') def copy_requisite_files(source_dir, target_dir): for req in ['images/', 'includes/']: - print 'cp ' + source_dir + req + ' ' + target_dir + req + print('cp ' + source_dir + req + ' ' + target_dir + req) shutil.copytree(source_dir + req, target_dir + req) def ensure_target_dirs_exist(target_dir, langs): diff --git a/licenses/03-cleanup-cc-html-files.py b/licenses/03-cleanup-cc-html-files.py index dabfb09..80f93cd 100755 --- a/licenses/03-cleanup-cc-html-files.py +++ b/licenses/03-cleanup-cc-html-files.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from bs4 import BeautifulSoup, Comment import os @@ -12,7 +12,7 @@ def main(argv): cleanup_legalcode_file('publicdomain/', 'CC0-1.0') for lang in langs: cleanup_deed_file('publicdomain/', 'CC0-1.0', lang) - print '' + print('') # Clean up Creative Commons license files cc_licenses = [ @@ -34,11 +34,11 @@ def main(argv): cleanup_legalcode_file('creativecommons/', license) for lang in langs: cleanup_deed_file('creativecommons/', license, lang) - print '' + print('') def cleanup_legalcode_file(src_dir, license): f_legalcode = os.path.join(src_dir, 'legalcode', license + '-legalcode.html') - print 'Cleaning up ' + f_legalcode + print('Cleaning up ' + f_legalcode) with open(f_legalcode, 'r+') as f: html = f.read() @@ -74,7 +74,7 @@ def cleanup_legalcode_file(src_dir, license): def cleanup_deed_file(src_dir, license, lang): f_deed = os.path.join(src_dir, lang, license + '.html') - print 'Cleaning up ' + f_deed + print('Cleaning up ' + f_deed) with open(f_deed, 'r+') as f: html = f.read() -- cgit v1.2.3