Skip to content

Instantly share code, notes, and snippets.

# Ioannes Barbarus
# nicholas.escalona@gmail.com
# requires:
# >= Python 3.4
# >= funcparserlib 0.3.6
# >= NetworkX 0.32
# >= NumPy 1.9.0
# >= Pillow 2.0.0
# >= tabulate 0.7.3
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[twoside,legalpaper]{geometry}
\usepackage{chngcntr}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\arabic{paragraph}.}
\setcounter{secnumdepth}{4}
\usepackage{titlesec}
import collections
import pathlib
import string
import sys
wd = pathlib.Path('SWMH-BETA')
glob = '**/*'
out_path = wd / '../out.txt'
binary = ['.dds', '.tga', '.xac', '.bmp', '.db']
suspicious = ['¡', '¤', '§', '°', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å',
#!/usr/bin/python
# -*- coding: cp1252 -*-
# -*- python-indent-offset: 4 -*-
import os
import sys
import shutil
import traceback
import time
[map.cpp:1445]: Province 1348 has no pixels in provinces.bmp
[map.cpp:1445]: Province 1950 has no pixels in provinces.bmp
[map.cpp:1445]: Province 1957 has no pixels in provinces.bmp
[map.cpp:1445]: Province 1958 has no pixels in provinces.bmp
[map.cpp:785]: Strait First Parameter Not Valid! Line: 127
[map.cpp:785]: Strait First Parameter Not Valid! Line: 128
[persistent.cpp:37]: Error: "Unexpected token: dignity, near line: 6
" in file: "common/dynasties/75_minor_titles_hre.txt" near line: 6
[persistent.cpp:37]: Error: "Unexpected token: grant_limit, near line: 7
" in file: "common/dynasties/75_minor_titles_hre.txt" near line: 7
def update_tree(v):
for n2, v2 in v:
if isinstance(n2, ck2parser.String):
if ck2parser.is_codename(n2.val):
for n3, v3 in v2:
if n3.val == 'capital':
prov_key = 'PROV{}'.format(v3.val)
capital_name = localisation[prov_key]
if not v3.post_comment:
v3.post_comment = ck2parser.Comment(
def process_province_history():
def mark_barony(barony, county_set):
try:
if barony.val.startswith('b_'):
county_set.add(barony.val)
except AttributeError:
pass
tree = ck2parser.parse_file(swmhpath / 'map/default.map')
defs = next(v.val for n, v in tree if n.val == 'definitions')
## normal scopes(including posttitle scopes) ##
# ROOT = receiver
# FROM = giver
# <no scope change> = attacker or receiver
## title scopes ##
# ROOT = receiver
# FROM = giver
# <no scope change> = thirdparty landed title
#
# the following effects/triggers exists (example execution order: on_success->on_success_title->on_success_posttitle):
########################################;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#TRIBALSCOTTISH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
########################################;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
tribal_baron_scottish;Toisech;Toisech;Toisech;;Toisech;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_female_scottish;Toisecha;Toisecha;Toisecha;;Toisecha;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_title_ruler_consort_scottish;Toisech;Toisech;Toisech;;Toisech;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_title_ruler_consort_female_scottish;Toisecha;Toisecha;Toisecha;;Toisecha;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_count_scottish;Earl;Earl;Earl;;Earl;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_count_title_ruler_consort_scottish;Earl;Earl;Earl;;Earl;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_duke_scottish;Mormaer;Mormaer;Mormaer;;Mormaer;;;;;;;;;x;;;;;;;;;;;;;;;