iniparse 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +19 -0
- data/README.rdoc +75 -0
- data/Rakefile +102 -0
- data/lib/iniparse.rb +68 -0
- data/lib/iniparse/document.rb +62 -0
- data/lib/iniparse/generator.rb +200 -0
- data/lib/iniparse/line_collection.rb +164 -0
- data/lib/iniparse/lines.rb +290 -0
- data/lib/iniparse/parser.rb +92 -0
- data/lib/iniparse/version.rb +3 -0
- data/spec/document_spec.rb +72 -0
- data/spec/fixture_spec.rb +166 -0
- data/spec/fixtures/openttd.ini +397 -0
- data/spec/fixtures/race07.ini +133 -0
- data/spec/fixtures/smb.ini +102 -0
- data/spec/generator/method_missing_spec.rb +104 -0
- data/spec/generator/with_section_blocks_spec.rb +322 -0
- data/spec/generator/without_section_blocks_spec.rb +136 -0
- data/spec/iniparse_spec.rb +21 -0
- data/spec/line_collection_spec.rb +212 -0
- data/spec/lines_spec.rb +409 -0
- data/spec/parser/document_parsing_spec.rb +50 -0
- data/spec/parser/line_parsing_spec.rb +367 -0
- data/spec/spec_fixtures.rb +46 -0
- data/spec/spec_helper.rb +164 -0
- data/spec/spec_helper_spec.rb +201 -0
- metadata +92 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
module IniParse
|
2
|
+
class Parser
|
3
|
+
cattr_accessor :parse_types
|
4
|
+
@@parse_types = [ IniParse::Lines::Option,
|
5
|
+
IniParse::Lines::Section,
|
6
|
+
IniParse::Lines::Blank ]
|
7
|
+
|
8
|
+
# Creates a new Parser instance for parsing string +source+.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# source<String>:: The source string.
|
12
|
+
#
|
13
|
+
def initialize(source)
|
14
|
+
@source = source.dup
|
15
|
+
end
|
16
|
+
|
17
|
+
# Parses the source string and returns the resulting data structure.
|
18
|
+
#
|
19
|
+
# ==== Returns
|
20
|
+
# IniParse::Document
|
21
|
+
#
|
22
|
+
def parse
|
23
|
+
IniParse::Generator.gen do |generator|
|
24
|
+
@source.split("\n", -1).each do |line|
|
25
|
+
generator.send(*Parser.parse_line(line))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class << self
|
31
|
+
# Takes a raw line from an INI document, striping out any inline
|
32
|
+
# comment, and indent, then returns the appropriate tuple so that the
|
33
|
+
# Generator instance can add the line to the Document.
|
34
|
+
#
|
35
|
+
# ==== Raises
|
36
|
+
# IniParse::ParseError: If the line could not be parsed.
|
37
|
+
#
|
38
|
+
def parse_line(line)
|
39
|
+
sanitized, opts = strip_indent(*strip_comment(line, {}))
|
40
|
+
|
41
|
+
parsed = nil
|
42
|
+
@@parse_types.each do |type|
|
43
|
+
break if (parsed = type.parse(sanitized, opts))
|
44
|
+
end
|
45
|
+
|
46
|
+
if parsed.nil?
|
47
|
+
raise IniParse::ParseError, <<-EOS.compress_lines
|
48
|
+
A line of your INI document could not be parsed to a LineType:
|
49
|
+
'#{line}'.
|
50
|
+
EOS
|
51
|
+
end
|
52
|
+
|
53
|
+
parsed
|
54
|
+
end
|
55
|
+
|
56
|
+
#######
|
57
|
+
private
|
58
|
+
#######
|
59
|
+
|
60
|
+
# Strips in inline comment from a line (or value), removes trailing
|
61
|
+
# whitespace and sets the comment options as applicable.
|
62
|
+
def strip_comment(line, opts)
|
63
|
+
if m = /^(.*?)(?:\s+(;|\#)\s*(.*))$/.match(line) ||
|
64
|
+
m = /(^)(?:(;|\#)\s*(.*))$/.match(line) # Comment lines.
|
65
|
+
opts[:comment] = m[3].rstrip
|
66
|
+
opts[:comment_sep] = m[2]
|
67
|
+
# Remove the line content (since an option value may contain a
|
68
|
+
# semi-colon) _then_ get the index of the comment separator.
|
69
|
+
opts[:comment_offset] =
|
70
|
+
line[(m[1].length..-1)].index(m[2]) + m[1].length
|
71
|
+
|
72
|
+
line = m[1]
|
73
|
+
else
|
74
|
+
line.rstrip!
|
75
|
+
end
|
76
|
+
|
77
|
+
[line, opts]
|
78
|
+
end
|
79
|
+
|
80
|
+
# Removes any leading whitespace from a line, and adds it to the options
|
81
|
+
# hash.
|
82
|
+
def strip_indent(line, opts)
|
83
|
+
if m = /^(\s+).*$/.match(line)
|
84
|
+
line.lstrip!
|
85
|
+
opts[:indent] = m[1]
|
86
|
+
end
|
87
|
+
|
88
|
+
[line, opts]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe "IniParse::Document" do
|
4
|
+
it 'should have a +sections+ reader' do
|
5
|
+
IniParse::Document.instance_methods.should include('lines')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should not have a +sections+ writer' do
|
9
|
+
IniParse::Document.instance_methods.should_not include('lines=')
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should delegate #[] to +lines+' do
|
13
|
+
doc = IniParse::Document.new
|
14
|
+
doc.lines.should_receive(:[]).with('key')
|
15
|
+
doc['key']
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should call #each to +lines+' do
|
19
|
+
doc = IniParse::Document.new
|
20
|
+
doc.lines.should_receive(:each)
|
21
|
+
doc.each { |l| }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#has_section?' do
|
25
|
+
before(:all) do
|
26
|
+
@doc = IniParse::Document.new
|
27
|
+
@doc.lines << IniParse::Lines::Section.new('first section')
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should return true if a section with the given key exists' do
|
31
|
+
@doc.should have_section('first section')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should return true if no section with the given key exists' do
|
35
|
+
@doc.should_not have_section('second section')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#save' do
|
40
|
+
describe 'when no path is given to save' do
|
41
|
+
it 'should save the INI document if a path was given when initialized' do
|
42
|
+
doc = IniParse::Document.new('/a/path/to/a/file.ini')
|
43
|
+
File.should_receive(:open).with('/a/path/to/a/file.ini', 'w')
|
44
|
+
doc.save
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should raise IniParseError if no path was given when initialized' do
|
48
|
+
lambda { IniParse::Document.new.save }.should \
|
49
|
+
raise_error(IniParse::IniParseError)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'when a path is given to save' do
|
54
|
+
it "should update the document's +path+" do
|
55
|
+
File.stub!(:open).and_return(true)
|
56
|
+
doc = IniParse::Document.new('/a/path/to/a/file.ini')
|
57
|
+
doc.save('/a/new/path.ini')
|
58
|
+
doc.path.should == '/a/new/path.ini'
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should save the INI document to the given path' do
|
62
|
+
File.should_receive(:open).with('/a/new/path.ini', 'w')
|
63
|
+
IniParse::Document.new('/a/path/to/a/file.ini').save('/a/new/path.ini')
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'should raise IniParseError if no path was given when initialized' do
|
67
|
+
lambda { IniParse::Document.new.save }.should \
|
68
|
+
raise_error(IniParse::IniParseError)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,166 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe "IniParse" do
|
4
|
+
describe 'openttd.ini fixture' do
|
5
|
+
before(:all) do
|
6
|
+
@fixture = fixture('openttd.ini')
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should parse without any errors' do
|
10
|
+
lambda { IniParse.parse(@fixture) }.should_not raise_error
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should have the correct sections' do
|
14
|
+
IniParse.parse(fixture('openttd.ini')).lines.keys.should == [
|
15
|
+
'misc', 'music', 'difficulty', 'game_creation', 'vehicle',
|
16
|
+
'construction', 'station', 'economy', 'pf', 'order', 'gui', 'ai',
|
17
|
+
'locale', 'network', 'currency', 'servers', 'bans', 'news_display',
|
18
|
+
'version', 'preset-J', 'newgrf', 'newgrf-static'
|
19
|
+
]
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should have the correct options' do
|
23
|
+
# Test the keys from one section.
|
24
|
+
doc = IniParse.parse(@fixture)
|
25
|
+
section = doc['misc']
|
26
|
+
|
27
|
+
section.lines.keys.should == [
|
28
|
+
'display_opt', 'news_ticker_sound', 'fullscreen', 'language',
|
29
|
+
'resolution', 'screenshot_format', 'savegame_format',
|
30
|
+
'rightclick_emulate', 'small_font', 'medium_font', 'large_font',
|
31
|
+
'small_size', 'medium_size', 'large_size', 'small_aa', 'medium_aa',
|
32
|
+
'large_aa', 'sprite_cache_size', 'player_face',
|
33
|
+
'transparency_options', 'transparency_locks', 'invisibility_options',
|
34
|
+
'keyboard', 'keyboard_caps'
|
35
|
+
]
|
36
|
+
|
37
|
+
# Test some of the options.
|
38
|
+
section['display_opt'].should == 'SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL|WAYPOINTS'
|
39
|
+
section['news_ticker_sound'].should be_false
|
40
|
+
section['language'].should == 'english_US.lng'
|
41
|
+
section['resolution'].should == '1680,936'
|
42
|
+
section['large_size'].should == 16
|
43
|
+
|
44
|
+
# Test some other options.
|
45
|
+
doc['currency']['suffix'].should == '" credits"'
|
46
|
+
doc['news_display']['production_nobody'].should == 'summarized'
|
47
|
+
doc['version']['version_number'].should == '070039B0'
|
48
|
+
|
49
|
+
doc['preset-J']['gcf/1_other/BlackCC/mauvetoblackw.grf'].should be_nil
|
50
|
+
doc['preset-J']['gcf/1_other/OpenGFX/OpenGFX_-_newFaces_v0.1.grf'].should be_nil
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should be identical to the original when calling #to_ini' do
|
54
|
+
IniParse.parse(@fixture).to_ini.should == @fixture
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe 'race07.ini fixture' do
|
59
|
+
before(:all) do
|
60
|
+
@fixture = fixture('race07.ini')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should parse without any errors' do
|
64
|
+
lambda { IniParse.parse(@fixture) }.should_not raise_error
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should have the correct sections' do
|
68
|
+
IniParse.parse(fixture('race07.ini')).lines.keys.should == [
|
69
|
+
'Header', 'Race', 'Slot010', 'Slot016', 'Slot013', 'Slot018',
|
70
|
+
'Slot002', 'END'
|
71
|
+
]
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should have the correct options' do
|
75
|
+
# Test the keys from one section.
|
76
|
+
doc = IniParse.parse(@fixture)
|
77
|
+
section = doc['Slot010']
|
78
|
+
|
79
|
+
section.lines.keys.should == [
|
80
|
+
'Driver', 'SteamUser', 'SteamId', 'Vehicle', 'Team', 'QualTime',
|
81
|
+
'Laps', 'Lap', 'LapDistanceTravelled', 'BestLap', 'RaceTime'
|
82
|
+
]
|
83
|
+
|
84
|
+
# Test some of the options.
|
85
|
+
section['Driver'].should == 'Mark Voss'
|
86
|
+
section['SteamUser'].should == 'mvoss'
|
87
|
+
section['SteamId'].should == 1865369
|
88
|
+
section['Vehicle'].should == 'Chevrolet Lacetti 2007'
|
89
|
+
section['Team'].should == 'TEMPLATE_TEAM'
|
90
|
+
section['QualTime'].should == '1:37.839'
|
91
|
+
section['Laps'].should == 13
|
92
|
+
section['LapDistanceTravelled'].should == 3857.750244
|
93
|
+
section['BestLap'].should == '1:38.031'
|
94
|
+
section['RaceTime'].should == '0:21:38.988'
|
95
|
+
|
96
|
+
section['Lap'].should == [
|
97
|
+
'(0, -1.000, 1:48.697)', '(1, 89.397, 1:39.455)',
|
98
|
+
'(2, 198.095, 1:38.060)', '(3, 297.550, 1:38.632)',
|
99
|
+
'(4, 395.610, 1:38.031)', '(5, 494.242, 1:39.562)',
|
100
|
+
'(6, 592.273, 1:39.950)', '(7, 691.835, 1:38.366)',
|
101
|
+
'(8, 791.785, 1:39.889)', '(9, 890.151, 1:39.420)',
|
102
|
+
'(10, 990.040, 1:39.401)', '(11, 1089.460, 1:39.506)',
|
103
|
+
'(12, 1188.862, 1:40.017)'
|
104
|
+
]
|
105
|
+
|
106
|
+
doc['Header']['Version'].should == '1.1.1.14'
|
107
|
+
doc['Header']['TimeString'].should == '2008/09/13 23:26:32'
|
108
|
+
doc['Header']['Aids'].should == '0,0,0,0,0,1,1,0,0'
|
109
|
+
|
110
|
+
doc['Race']['AIDB'].should == 'GameData\Locations\Anderstorp_2007\2007_ANDERSTORP.AIW'
|
111
|
+
doc['Race']['Race Length'].should == 0.1
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'should be identical to the original when calling #to_ini' do
|
115
|
+
pending('awaiting presevation (or lack) of whitespace around =') do
|
116
|
+
IniParse.parse(@fixture).to_ini.should == @fixture
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe 'smb.ini fixture' do
|
122
|
+
before(:all) do
|
123
|
+
@fixture = fixture('smb.ini')
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'should parse without any errors' do
|
127
|
+
lambda { IniParse.parse(@fixture) }.should_not raise_error
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should have the correct sections' do
|
131
|
+
IniParse.parse(@fixture).lines.keys.should == [
|
132
|
+
'global', 'printers'
|
133
|
+
]
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'should have the correct options' do
|
137
|
+
# Test the keys from one section.
|
138
|
+
doc = IniParse.parse(@fixture)
|
139
|
+
section = doc['global']
|
140
|
+
|
141
|
+
section.lines.keys.should == [
|
142
|
+
'debug pid', 'log level', 'server string', 'printcap name',
|
143
|
+
'printing', 'encrypt passwords', 'use spnego', 'passdb backend',
|
144
|
+
'idmap domains', 'idmap config default: default',
|
145
|
+
'idmap config default: backend', 'idmap alloc backend',
|
146
|
+
'idmap negative cache time', 'map to guest', 'guest account',
|
147
|
+
'unix charset', 'display charset', 'dos charset', 'vfs objects',
|
148
|
+
'os level', 'domain master', 'max xmit', 'use sendfile',
|
149
|
+
'stream support', 'ea support', 'darwin_streams:brlm',
|
150
|
+
'enable core files', 'usershare max shares', 'usershare path',
|
151
|
+
'usershare owner only', 'usershare allow guests',
|
152
|
+
'usershare allow full config', 'com.apple:filter shares by access',
|
153
|
+
'obey pam restrictions', 'acl check permissions',
|
154
|
+
'name resolve order', 'include'
|
155
|
+
]
|
156
|
+
|
157
|
+
section['display charset'].should == 'UTF-8-MAC'
|
158
|
+
section['vfs objects'].should == 'darwinacl,darwin_streams'
|
159
|
+
section['usershare path'].should == '/var/samba/shares'
|
160
|
+
end
|
161
|
+
|
162
|
+
it 'should be identical to the original when calling #to_ini' do
|
163
|
+
IniParse.parse(@fixture).to_ini.should == @fixture
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
@@ -0,0 +1,397 @@
|
|
1
|
+
|
2
|
+
[misc]
|
3
|
+
display_opt = SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL|WAYPOINTS
|
4
|
+
news_ticker_sound = false
|
5
|
+
fullscreen = false
|
6
|
+
language = english_US.lng
|
7
|
+
resolution = 1680,936
|
8
|
+
screenshot_format =
|
9
|
+
savegame_format =
|
10
|
+
rightclick_emulate = false
|
11
|
+
small_font =
|
12
|
+
medium_font =
|
13
|
+
large_font =
|
14
|
+
small_size = 6
|
15
|
+
medium_size = 10
|
16
|
+
large_size = 16
|
17
|
+
small_aa = false
|
18
|
+
medium_aa = false
|
19
|
+
large_aa = false
|
20
|
+
sprite_cache_size = 4
|
21
|
+
player_face = 0
|
22
|
+
transparency_options = 3
|
23
|
+
transparency_locks = 0
|
24
|
+
invisibility_options = 30
|
25
|
+
keyboard =
|
26
|
+
keyboard_caps =
|
27
|
+
|
28
|
+
[music]
|
29
|
+
playlist = 0
|
30
|
+
music_vol = 0
|
31
|
+
effect_vol = 0
|
32
|
+
custom_1 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
33
|
+
custom_2 = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
34
|
+
playing = false
|
35
|
+
shuffle = false
|
36
|
+
extmidi = timidity
|
37
|
+
|
38
|
+
[difficulty]
|
39
|
+
max_no_competitors = 0
|
40
|
+
competitor_start_time = 2
|
41
|
+
number_towns = 1
|
42
|
+
number_industries = 2
|
43
|
+
max_loan = 500000
|
44
|
+
initial_interest = 2
|
45
|
+
vehicle_costs = 0
|
46
|
+
competitor_speed = 2
|
47
|
+
competitor_intelligence = 0
|
48
|
+
vehicle_breakdowns = 1
|
49
|
+
subsidy_multiplier = 2
|
50
|
+
construction_cost = 0
|
51
|
+
terrain_type = 0
|
52
|
+
quantity_sea_lakes = 0
|
53
|
+
economy = 0
|
54
|
+
line_reverse_mode = 0
|
55
|
+
disasters = 0
|
56
|
+
town_council_tolerance = 0
|
57
|
+
diff_level = 3
|
58
|
+
|
59
|
+
[game_creation]
|
60
|
+
town_name = english
|
61
|
+
landscape = temperate
|
62
|
+
snow_line = 56
|
63
|
+
snow_line_height = 7
|
64
|
+
starting_year = 1960
|
65
|
+
land_generator = 1
|
66
|
+
oil_refinery_limit = 32
|
67
|
+
tgen_smoothness = 0
|
68
|
+
generation_seed = 83252223
|
69
|
+
tree_placer = 2
|
70
|
+
heightmap_rotation = 0
|
71
|
+
se_flat_world_height = 0
|
72
|
+
map_x = 9
|
73
|
+
map_y = 9
|
74
|
+
|
75
|
+
[vehicle]
|
76
|
+
road_side = left
|
77
|
+
realistic_acceleration = true
|
78
|
+
mammoth_trains = true
|
79
|
+
never_expire_vehicles = true
|
80
|
+
max_trains = 500
|
81
|
+
max_roadveh = 500
|
82
|
+
max_aircraft = 200
|
83
|
+
max_ships = 300
|
84
|
+
servint_ispercent = false
|
85
|
+
servint_trains = 150
|
86
|
+
servint_roadveh = 150
|
87
|
+
servint_ships = 360
|
88
|
+
servint_aircraft = 100
|
89
|
+
wagon_speed_limits = true
|
90
|
+
disable_elrails = false
|
91
|
+
freight_trains = 1
|
92
|
+
plane_speed = 4
|
93
|
+
dynamic_engines = false
|
94
|
+
extend_vehicle_life = 0
|
95
|
+
|
96
|
+
[construction]
|
97
|
+
build_on_slopes = true
|
98
|
+
autoslope = true
|
99
|
+
extra_dynamite = false
|
100
|
+
longbridges = true
|
101
|
+
signal_side = true
|
102
|
+
road_stop_on_town_road = true
|
103
|
+
raw_industry_construction = 1
|
104
|
+
|
105
|
+
[station]
|
106
|
+
always_small_airport = true
|
107
|
+
join_stations = true
|
108
|
+
nonuniform_stations = true
|
109
|
+
station_spread = 12
|
110
|
+
modified_catchment = true
|
111
|
+
adjacent_stations = true
|
112
|
+
|
113
|
+
[economy]
|
114
|
+
town_layout = 2
|
115
|
+
station_noise_level = false
|
116
|
+
inflation = true
|
117
|
+
multiple_industry_per_town = true
|
118
|
+
same_industry_close = true
|
119
|
+
bribe = true
|
120
|
+
exclusive_rights = true
|
121
|
+
give_money = true
|
122
|
+
smooth_economy = true
|
123
|
+
allow_shares = false
|
124
|
+
town_growth_rate = 1
|
125
|
+
larger_towns = 6
|
126
|
+
initial_city_size = 2
|
127
|
+
mod_road_rebuild = true
|
128
|
+
dist_local_authority = 20
|
129
|
+
town_noise_population = 800,2000,4000
|
130
|
+
|
131
|
+
[pf]
|
132
|
+
forbid_90_deg = false
|
133
|
+
roadveh_queue = true
|
134
|
+
pathfinder_for_trains = 2
|
135
|
+
pathfinder_for_roadvehs = 2
|
136
|
+
pathfinder_for_ships = 0
|
137
|
+
wait_oneway_signal = 15
|
138
|
+
wait_twoway_signal = 41
|
139
|
+
wait_for_pbs_path = 30
|
140
|
+
reserve_paths = false
|
141
|
+
path_backoff_interval = 20
|
142
|
+
opf.pf_maxlength = 4096
|
143
|
+
opf.pf_maxdepth = 48
|
144
|
+
npf.npf_max_search_nodes = 10000
|
145
|
+
npf.npf_rail_firstred_penalty = 1000
|
146
|
+
npf.npf_rail_firstred_exit_penalty = 10000
|
147
|
+
npf.npf_rail_lastred_penalty = 1000
|
148
|
+
npf.npf_rail_station_penalty = 100
|
149
|
+
npf.npf_rail_slope_penalty = 100
|
150
|
+
npf.npf_rail_curve_penalty = 1
|
151
|
+
npf.npf_rail_depot_reverse_penalty = 5000
|
152
|
+
npf.npf_rail_pbs_cross_penalty = 300
|
153
|
+
npf.npf_rail_pbs_signal_back_penalty = 1500
|
154
|
+
npf.npf_buoy_penalty = 200
|
155
|
+
npf.npf_water_curve_penalty = 25
|
156
|
+
npf.npf_road_curve_penalty = 1
|
157
|
+
npf.npf_crossing_penalty = 300
|
158
|
+
npf.npf_road_drive_through_penalty = 800
|
159
|
+
yapf.disable_node_optimization = false
|
160
|
+
yapf.max_search_nodes = 10000
|
161
|
+
yapf.rail_firstred_twoway_eol = true
|
162
|
+
yapf.rail_firstred_penalty = 1000
|
163
|
+
yapf.rail_firstred_exit_penalty = 10000
|
164
|
+
yapf.rail_lastred_penalty = 1000
|
165
|
+
yapf.rail_lastred_exit_penalty = 10000
|
166
|
+
yapf.rail_station_penalty = 1000
|
167
|
+
yapf.rail_slope_penalty = 200
|
168
|
+
yapf.rail_curve45_penalty = 300
|
169
|
+
yapf.rail_curve90_penalty = 600
|
170
|
+
yapf.rail_depot_reverse_penalty = 5000
|
171
|
+
yapf.rail_crossing_penalty = 300
|
172
|
+
yapf.rail_look_ahead_max_signals = 10
|
173
|
+
yapf.rail_look_ahead_signal_p0 = 500
|
174
|
+
yapf.rail_look_ahead_signal_p1 = -100
|
175
|
+
yapf.rail_look_ahead_signal_p2 = 5
|
176
|
+
yapf.rail_pbs_cross_penalty = 300
|
177
|
+
yapf.rail_pbs_station_penalty = 800
|
178
|
+
yapf.rail_pbs_signal_back_penalty = 1500
|
179
|
+
yapf.rail_doubleslip_penalty = 100
|
180
|
+
yapf.rail_longer_platform_penalty = 800
|
181
|
+
yapf.rail_longer_platform_per_tile_penalty = 0
|
182
|
+
yapf.rail_shorter_platform_penalty = 4000
|
183
|
+
yapf.rail_shorter_platform_per_tile_penalty = 0
|
184
|
+
yapf.road_slope_penalty = 200
|
185
|
+
yapf.road_curve_penalty = 100
|
186
|
+
yapf.road_crossing_penalty = 300
|
187
|
+
yapf.road_stop_penalty = 800
|
188
|
+
|
189
|
+
[order]
|
190
|
+
gotodepot = true
|
191
|
+
no_servicing_if_no_breakdowns = true
|
192
|
+
timetabling = true
|
193
|
+
improved_load = true
|
194
|
+
selectgoods = true
|
195
|
+
serviceathelipad = true
|
196
|
+
gradual_loading = true
|
197
|
+
|
198
|
+
[gui]
|
199
|
+
colored_news_year = 1901
|
200
|
+
ending_year = 2051
|
201
|
+
autosave = yearly
|
202
|
+
vehicle_speed = true
|
203
|
+
status_long_date = true
|
204
|
+
show_finances = true
|
205
|
+
autoscroll = false
|
206
|
+
reverse_scroll = true
|
207
|
+
smooth_scroll = false
|
208
|
+
measure_tooltip = true
|
209
|
+
errmsg_duration = 5
|
210
|
+
toolbar_pos = 1
|
211
|
+
window_snap_radius = 10
|
212
|
+
population_in_label = true
|
213
|
+
link_terraform_toolbar = true
|
214
|
+
liveries = 2
|
215
|
+
prefer_teamchat = false
|
216
|
+
scrollwheel_scrolling = 0
|
217
|
+
scrollwheel_multiplier = 5
|
218
|
+
pause_on_newgame = false
|
219
|
+
advanced_vehicle_list = 2
|
220
|
+
timetable_in_ticks = false
|
221
|
+
loading_indicators = 1
|
222
|
+
default_rail_type = 6
|
223
|
+
enable_signal_gui = true
|
224
|
+
drag_signals_density = 4
|
225
|
+
semaphore_build_before = 1975
|
226
|
+
train_income_warn = true
|
227
|
+
order_review_system = 2
|
228
|
+
lost_train_warn = true
|
229
|
+
autorenew = true
|
230
|
+
autorenew_months = 12
|
231
|
+
autorenew_money = 80000
|
232
|
+
always_build_infrastructure = false
|
233
|
+
new_nonstop = false
|
234
|
+
keep_all_autosave = false
|
235
|
+
autosave_on_exit = false
|
236
|
+
max_num_autosaves = 16
|
237
|
+
bridge_pillars = true
|
238
|
+
auto_euro = true
|
239
|
+
news_message_timeout = 2
|
240
|
+
show_track_reservation = false
|
241
|
+
default_signal_type = 0
|
242
|
+
cycle_signal_types = 0
|
243
|
+
console_backlog_timeout = 100
|
244
|
+
console_backlog_length = 100
|
245
|
+
network_chat_box_width = 700
|
246
|
+
network_chat_box_height = 25
|
247
|
+
right_mouse_btn_emulation = 0
|
248
|
+
|
249
|
+
[ai]
|
250
|
+
ainew_active = false
|
251
|
+
ai_in_multiplayer = false
|
252
|
+
ai_disable_veh_train = false
|
253
|
+
ai_disable_veh_roadveh = false
|
254
|
+
ai_disable_veh_aircraft = false
|
255
|
+
ai_disable_veh_ship = false
|
256
|
+
|
257
|
+
[locale]
|
258
|
+
currency = GBP
|
259
|
+
units = imperial
|
260
|
+
|
261
|
+
[network]
|
262
|
+
max_join_time = 500
|
263
|
+
pause_on_join = true
|
264
|
+
server_bind_ip = 0.0.0.0
|
265
|
+
server_port = 3979
|
266
|
+
server_advertise = false
|
267
|
+
lan_internet = 1
|
268
|
+
client_name = Ant
|
269
|
+
server_password =
|
270
|
+
rcon_password =
|
271
|
+
default_company_pass =
|
272
|
+
server_name =
|
273
|
+
connect_to_ip =
|
274
|
+
network_id =
|
275
|
+
autoclean_companies = false
|
276
|
+
autoclean_unprotected = 12
|
277
|
+
autoclean_protected = 36
|
278
|
+
max_companies = 8
|
279
|
+
max_clients = 10
|
280
|
+
max_spectators = 10
|
281
|
+
restart_game_year = 0
|
282
|
+
min_active_clients = 0
|
283
|
+
server_lang = ANY
|
284
|
+
reload_cfg = false
|
285
|
+
last_host =
|
286
|
+
last_port =
|
287
|
+
|
288
|
+
[currency]
|
289
|
+
rate = 1
|
290
|
+
separator = .
|
291
|
+
to_euro = 0
|
292
|
+
prefix = ""
|
293
|
+
suffix = " credits"
|
294
|
+
|
295
|
+
[servers]
|
296
|
+
|
297
|
+
[bans]
|
298
|
+
|
299
|
+
[news_display]
|
300
|
+
arrival_player = summarized
|
301
|
+
arrival_other = summarized
|
302
|
+
accident = full
|
303
|
+
company_info = full
|
304
|
+
open = summarized
|
305
|
+
close = summarized
|
306
|
+
economy = summarized
|
307
|
+
production_player = full
|
308
|
+
production_other = full
|
309
|
+
production_nobody = summarized
|
310
|
+
advice = full
|
311
|
+
new_vehicles = full
|
312
|
+
acceptance = summarized
|
313
|
+
subsidies = summarized
|
314
|
+
general = summarized
|
315
|
+
|
316
|
+
[version]
|
317
|
+
version_string = r14768
|
318
|
+
version_number = 070039B0
|
319
|
+
|
320
|
+
[preset-J]
|
321
|
+
gcf/1_other/BlackCC/mauvetoblackw.grf =
|
322
|
+
gcf/1_other/OpenGFX/newbuildings.grf =
|
323
|
+
gcf/1_other/OpenGFX/OpenGFX_NewShips_v0.1.grf =
|
324
|
+
gcf/1_other/OpenGFX/OpenGFX_NewWaterFeatures.grf =
|
325
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newEyeCandy_v0.2.grf =
|
326
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newFaces_v0.1.grf =
|
327
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newFonts_-_Newspaper_Fonts_v0.1.grf =
|
328
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newFonts_-_Small_Fonts_v0.1.grf =
|
329
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newIndustries_v0.8.grf =
|
330
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newInfrastructure_-_Airports_v0.1.grf =
|
331
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newInfrastructure_-_newBridges_v0.1.grf =
|
332
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newInfrastructure_v0.6.grf =
|
333
|
+
gcf/1_other/OpenGFX/OpenGFX_NewLandscape_v0.3.1.grf =
|
334
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newTerrain_v0.4.grf =
|
335
|
+
gcf/4_infrastructure/transrapidtrackset/z/signals.grf =
|
336
|
+
gcf/8_vehicles/trains_wagons/pb_ukrs/pb_ukrs.grf =
|
337
|
+
gcf/8_vehicles/trains_wagons/pb_ukrs/ukrsap1w.grf =
|
338
|
+
gcf/6_town_buildings/ttrs3/ttrs3w.GRF =
|
339
|
+
gcf/7_stations/basic_platforms/basic_platformsw.grf =
|
340
|
+
gcf/1_other/townnames/british/brit_names.grf =
|
341
|
+
gcf/7_stations/indstatr/indstatrw.grf =
|
342
|
+
gcf/5_industries_cargos/pikkind/pikkindw.grf =
|
343
|
+
gcf/4_infrastructure/ukroadset/UKRoadsetw.grf =
|
344
|
+
gcf/7_stations/newstats/newstatsw.grf =
|
345
|
+
gcf/4_infrastructure/nhfoundations/nhfoundationsw.grf =
|
346
|
+
gcf/4_infrastructure/bktun/BKTunw.grf =
|
347
|
+
gcf/7_stations/buffers/buffers.grf =
|
348
|
+
gcf/8_vehicles/planes/pb_av8/pb_av8w.grf =
|
349
|
+
gcf/8_vehicles/road_vehicles/egrvts/egrvts.grf =
|
350
|
+
gcf/4_infrastructure/b_newbridges/newbridgesW.GRF =
|
351
|
+
gcf/8_vehicles/ships/newships/newshipsw.grf =
|
352
|
+
gcf/8_vehicles/ships/newships/nshp_ecs.grf =
|
353
|
+
gcf/4_infrastructure/nhdep/nhdepw.grf =
|
354
|
+
gcf/4_infrastructure/fence/fencew.grf =
|
355
|
+
gcf/2_landscape/stolentrees/stolentreesw_162_108.grf =
|
356
|
+
gcf/5_industries_cargos/pikkind/z/pikbrikw.grf =
|
357
|
+
|
358
|
+
[newgrf]
|
359
|
+
gcf/2_landscape/rivers/riversw.grf =
|
360
|
+
gcf/1_other/townnames/british/brit_names.grf =
|
361
|
+
gcf/8_vehicles/planes/pb_av8/pb_av8w.grf =
|
362
|
+
gcf/8_vehicles/trains_wagons/empty/empty.grf =
|
363
|
+
gcf/8_vehicles/road_vehicles/grvts/egrvts.grf =
|
364
|
+
gcf/7_stations/buffers/buffers.grf =
|
365
|
+
gcf/8_vehicles/road_vehicles/heqsdt/heqsdt.grf =
|
366
|
+
gcf/7_stations/indstatr/indstatrw.grf =
|
367
|
+
gcf/1_other/BlackCC/mauvetoblackw.grf =
|
368
|
+
gcf/4_infrastructure/b_newtramtracks/NewTramTracksW_v0.4.1.grf =
|
369
|
+
gcf/4_infrastructure/nhfoundations/nhfoundationsw.grf =
|
370
|
+
gcf/8_vehicles/ships/newships/newshipsw.grf =
|
371
|
+
gcf/8_vehicles/ships/newships/nshp_ecs.grf =
|
372
|
+
gcf/7_stations/newstats/newstatsw.grf =
|
373
|
+
gcf/4_infrastructure/nhdep/nhdepw.grf =
|
374
|
+
gcf/1_other/OpenGFX/morebuildings.grf =
|
375
|
+
gcf/1_other/OpenGFX/newbuildings022.grf =
|
376
|
+
gcf/1_other/OpenGFX/hq.grf =
|
377
|
+
gcf/1_other/OpenGFX/OpenGFX_NewWaterFeatures.grf =
|
378
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newEyeCandy_v0.2.grf =
|
379
|
+
gcf/1_other/OpenGFX/OpenGFX_NewIndustries_v0.10.1.grf =
|
380
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newInfrastructure_-_Airports_v0.1.grf =
|
381
|
+
gcf/1_other/OpenGFX/OpenGFX_newInfrastructure_v0.7.grf =
|
382
|
+
gcf/1_other/OpenGFX/OpenGFX_NewLandscape_v0.3.1.grf =
|
383
|
+
gcf/1_other/OpenGFX/OpenGFX_-_newTerrain_v0.4.grf =
|
384
|
+
gcf/5_industries_cargos/pikkind/pikkindw.grf =
|
385
|
+
gcf/2_landscape/stolentrees/stolentreesw_162_108.grf =
|
386
|
+
gcf/4_infrastructure/totalbridges/total_bridges.grf =
|
387
|
+
gcf/7_stations/ukwaypoints/ukwaypointsw.grf =
|
388
|
+
gcf/8_vehicles/trains_wagons/pb_ukrs/pb_ukrs.grf = 0 3 0
|
389
|
+
gcf/8_vehicles/trains_wagons/pb_ukrs/ukrsap1w.grf =
|
390
|
+
gcf/4_infrastructure/yarrs/yarrs.grf =
|
391
|
+
gcf/6_town_buildings/w2w/w2w.grf =
|
392
|
+
gcf/1_other/townnames/welsh/welshnames.grf =
|
393
|
+
gcf/2_landscape/smoothsnow/smoothsnoww.grf =
|
394
|
+
gcf/6_town_buildings/pb_ukrh/pb_ukrhw.grf =
|
395
|
+
gcf/9_last/shiptool/shiptoolv4.grf =
|
396
|
+
|
397
|
+
[newgrf-static]
|