Chinese "Communist" "Dictatorship" "facts". 中国《共产主义》《独裁统治》的《事实》。Home to the mega-FAQ, news compilation, restaurant and music recommendations. 常见问答集,新闻集和饭店和音乐建议。Heil Xi 卐. 习万岁。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
751 B

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
https://github.com/cirosantilli/china-dictatorship#mirrors
'''
import json
import re
import sys
with open('package.json') as f:
package_json = json.load(f)
version_string = package_json['version']
version_re = re.compile(" version='0.0.\d+'")
with open('setup.py', 'r') as f:
setup_py_lines = f.readlines()
setup_py_new_lines = []
for line in setup_py_lines:
line = line.rstrip()
match = version_re.match(line)
if match:
setup_py_new_lines.append(" version='{}',".format(version_string))
else:
setup_py_new_lines.append(line)
setup_py_new_string = '\n'.join(setup_py_new_lines) + '\n'
with open('setup.py', 'w') as f:
f.write(setup_py_new_string)