Merge pull request #4824 from Citadel-Station-13/upstream-merge-34434
[MIRROR] Enforces utf-8 encoding on all changelog files.
This commit is contained in:
+2
-2
@@ -28,8 +28,8 @@ addons:
|
||||
- libc6-i386
|
||||
- libgcc1:i386
|
||||
- libstdc++6:i386
|
||||
- python
|
||||
- python-pip
|
||||
- python3
|
||||
- python3-pip
|
||||
|
||||
install:
|
||||
- tools/travis/install_build_tools.sh
|
||||
|
||||
@@ -73,7 +73,7 @@ changelog_cache = os.path.join(args.ymlDir, '.all_changelog.yml')
|
||||
failed_cache_read = True
|
||||
if os.path.isfile(changelog_cache):
|
||||
try:
|
||||
with open(changelog_cache) as f:
|
||||
with open(changelog_cache,encoding='utf-8') as f:
|
||||
(_, all_changelog_entries) = yaml.load_all(f)
|
||||
failed_cache_read = False
|
||||
|
||||
@@ -100,7 +100,7 @@ if failed_cache_read and os.path.isfile(args.targetFile):
|
||||
from bs4 import BeautifulSoup
|
||||
from bs4.element import NavigableString
|
||||
print(' Generating cache...')
|
||||
with open(args.targetFile, 'r') as f:
|
||||
with open(args.targetFile, 'r', encoding='utf-8') as f:
|
||||
soup = BeautifulSoup(f)
|
||||
for e in soup.find_all('div', {'class':'commit'}):
|
||||
entry = {}
|
||||
@@ -141,7 +141,7 @@ for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")):
|
||||
fileName = os.path.abspath(fileName)
|
||||
print(' Reading {}...'.format(fileName))
|
||||
cl = {}
|
||||
with open(fileName, 'r') as f:
|
||||
with open(fileName, 'r',encoding='utf-8') as f:
|
||||
cl = yaml.load(f)
|
||||
f.close()
|
||||
if today not in all_changelog_entries:
|
||||
@@ -170,13 +170,13 @@ for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")):
|
||||
if args.dryRun: continue
|
||||
|
||||
cl['changes'] = []
|
||||
with open(fileName, 'w') as f:
|
||||
with open(fileName, 'w', encoding='utf-8') as f:
|
||||
yaml.dump(cl, f, default_flow_style=False)
|
||||
|
||||
targetDir = os.path.dirname(args.targetFile)
|
||||
|
||||
with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.targetFile, 'w') as changelog:
|
||||
with open(os.path.join(targetDir, 'templates', 'header.html'), 'r') as h:
|
||||
with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.targetFile, 'w', encoding='utf-8') as changelog:
|
||||
with open(os.path.join(targetDir, 'templates', 'header.html'), 'r', encoding='utf-8') as h:
|
||||
for line in h:
|
||||
changelog.write(line)
|
||||
|
||||
@@ -203,7 +203,7 @@ with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.t
|
||||
if write_entry:
|
||||
changelog.write(entry_htm)
|
||||
|
||||
with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r') as h:
|
||||
with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r', encoding='utf-8') as h:
|
||||
for line in h:
|
||||
changelog.write(line)
|
||||
|
||||
|
||||
@@ -12,5 +12,5 @@ then
|
||||
php -l tools/TGUICompiler.php;
|
||||
echo "Checking for JSON errors";
|
||||
find . -name "*.json" -not -path "./tgui/node_modules/*" | xargs -0 python3 ./tools/json_verifier.py;
|
||||
python tools/ss13_genchangelog.py html/changelog.html html/changelogs;
|
||||
python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs;
|
||||
fi;
|
||||
|
||||
@@ -4,8 +4,8 @@ set -e
|
||||
if [ "$BUILD_TOOLS" = true ]; then
|
||||
rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $NODE_VERSION
|
||||
npm install -g gulp-cli
|
||||
pip install --user PyYaml -q
|
||||
pip install --user beautifulsoup4 -q
|
||||
pip3 install --user PyYaml -q
|
||||
pip3 install --user beautifulsoup4 -q
|
||||
fi;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user