Skip to content

Commit

Permalink
✨ add feature text
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Aug 27, 2017
1 parent 2faa8f6 commit d76b4cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions features.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Provinces:
"贵州","河南","山东","四川","江苏","青海","福建","浙江","湖北","江西","西藏","黑龙江","广东","云南","广西","陕西","甘肃","河北","宁夏","吉林","湖南","安徽","内蒙古","山西","海南","辽宁"
Cities:
六盘水,安顺,毕节,贵阳,遵义,铜仁,黔东南苗族侗族自治州,黔南布依族苗族自治州,黔西南布依族苗族自治州,三门峡,信阳,南阳,周口,商丘,安阳,平顶山,开封,新乡,洛阳,漯河,濮阳,焦作,许昌,郑州,驻马店,鹤壁,东营,临沂,威海,德州,日照,枣庄,泰安,济南,济宁,淄博,滨州,潍坊,烟台,聊城,莱芜,菏泽,青岛,乐山,内江,凉山彝族自治州,南充,宜宾,巴中,广元,广安,德阳,成都,攀枝花,泸州,甘孜藏族自治州,眉山,绵阳,自贡,资阳,达州,遂宁,阿坝藏族羌族自治州,雅安,南京,南通,宿迁,常州,徐州,扬州,无锡,泰州,淮安,盐城,苏州,连云港,镇江,果洛藏族自治州,海东,海北藏族自治州,海南藏族自治州,海西蒙古族藏族自治州,玉树藏族自治州,西宁,黄南藏族自治州,三明,南平,厦门,宁德,泉州,漳州,福州,莆田,龙岩,丽水,台州,嘉兴,宁波,杭州,温州,湖州,绍兴,舟山,衢州,金华,十堰,咸宁,孝感,宜昌,恩施土家族苗族自治州,武汉,荆州,荆门,襄阳,鄂州,随州,黄冈,黄石,上饶,九江,南昌,吉安,宜春,抚州,新余,景德镇,萍乡,赣州,鹰潭,山南,拉萨,日喀则,昌都,林芝,那曲地区,阿里地区,七台河,伊春,佳木斯,双鸭山,哈尔滨,大兴安岭地区,大庆,牡丹江,绥化,鸡西,鹤岗,黑河,齐齐哈尔,云浮,佛山,广州,惠州,揭阳,梅州,汕头,汕尾,江门,河源,深圳,清远,湛江,潮州,珠海,肇庆,茂名,阳江,韶关,临沧,丽江,保山,大理白族自治州,德宏傣族景颇族自治州,怒江傈僳族自治州,文山壮族苗族自治州,昆明,昭通,普洱,曲靖,楚雄彝族自治州,玉溪,红河哈尼族彝族自治州,西双版纳傣族自治州,迪庆藏族自治州,北海,南宁,崇左,来宾,柳州,桂林,梧州,河池,玉林,百色,贵港,贺州,钦州,防城港,咸阳,商洛,安康,宝鸡,延安,榆林,汉中,渭南,西安,铜川,临夏回族自治州,兰州,天水,定西,平凉,庆阳,张掖,武威,甘南藏族自治州,白银,酒泉,金昌,陇南,保定,唐山,廊坊,张家口,承德,石家庄,秦皇岛,衡水,邢台,邯郸,中卫,吴忠,固原,石嘴山,银川,吉林,四平,延边朝鲜族自治州,松原,白城,白山,辽源,通化,长春,娄底,岳阳,常德,张家界,怀化,株洲,永州,湘潭,湘西土家族苗族自治州,益阳,衡阳,邵阳,郴州,长沙,亳州,六安,合肥,安庆,宣城,宿州,池州,淮北,淮南,滁州,芜湖,蚌埠,铜陵,阜阳,马鞍山,黄山,乌兰察布,乌海,兴安盟,包头,呼伦贝尔,呼和浩特,巴彦淖尔,赤峰,通辽,鄂尔多斯,锡林郭勒盟,阿拉善盟,临汾,吕梁,大同,太原,忻州,晋中,晋城,朔州,运城,长治,阳泉,万宁,三亚,三沙,东方,临高县,乐东黎族自治县,五指山,保亭黎族苗族自治县,儋州,定安县,屯昌县,文昌,昌江黎族自治县,海口,澄迈县,琼中黎族苗族自治县,琼海,白沙黎族自治县,陵水黎族自治县,丹东,大连,抚顺,朝阳,本溪,沈阳,盘锦,营口,葫芦岛,辽阳,铁岭,锦州,阜新,鞍山
5 changes: 5 additions & 0 deletions makedemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ def list_a_directory(src_folder):
config_json = config.render(names=name_dict, registry=rendering_dict)
with codecs.open(os.path.join('dist', 'config.json'), 'wb', 'utf-8') as f:
f.write(config_json)

feature = jinja2_env.get_template('features.txt')
feature_txt = feature.render(names=name_dict, registry=rendering_dict)
with codecs.open(os.path.join('features.txt'), 'wb', 'utf-8') as f:
f.write(feature_txt)
11 changes: 11 additions & 0 deletions templates/features.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Provinces:
{% set comma = joiner(",") %}
{% for cprovince in registry.keys() %}
{{ comma() }}"{{cprovince}}"{% endfor %}

Cities:
{% set comma = joiner(",") %}
{% for cprovince in registry.keys() %}
{% for city in registry[cprovince] %}
{{ comma() }}{{city[0]}}{% endfor %}
{% endfor %}

0 comments on commit d76b4cf

Please sign in to comment.