import _initpath import pyradox import re result = pyradox.parse(r""" r = rgb { 1 100 200 } h = hsv { 0.3 0.6 0.9 } """) print(result)
import _initpath import pyradox import re result = pyradox.parse(r""" random_owned_controlled_state = { prioritize = { 43 } limit = { ROOT = { has_full_control_of_state = PREV } } create_unit = { division = "name = \"1. Light Division\" division_template = \"Light Division\" start_experience_factor = 1.0" owner = HUN } } """) print(result)
result = pyradox.parse(""" # pre comment foo = bar # line comment 0 1 # pre comment = # pre comment 3 # line comment empty_tree = {} # tree test tree = { # pre comment in tree foo = bar # line comment in tree # tree end comment } # tree line comment # group outside precomment? group = { # group item precomment foo # line comment in group bar baz # group item postcomment } # group outside postcomment? list2 = {1 2 3} # file end comment (or item outside postcomment?) """)
import _initpath import pyradox import re result = pyradox.parse(r""" with_days = 1444.1.1 with_hours = 1939.1.1.12 """) print(result) print(pyradox.Time.from_days_since_1_ad(365 + 32))
#result = pyradox.txt.parse_file('D:/Steam/steamapps/common/Europa Universalis IV/common/prices/00_prices.txt') #print(result) result = pyradox.parse(""" regular_group = { 1 2 3 } empty_tree = {} mixed_group = { 10 {} { a = 1 b = 2 } 20 } player_countries={ ITA={ user="******" country_leader=yes pinned_theatres={ { id=16 type=67 } } } } """) print(result)