@@ -7,19 +7,31 @@ Basic Usage
77-------------
88
99The sc2reader package itself can be configured and used to read replay files
10- right out of the box! This lightweight approach to usage provides sane default
11- options so no configuration is necessary for most normal usage. Read accepts
12- either a file or a directory and returns either a single replay or a list of
13- replays as the result.
10+ right out of the box! This lightweight approach to usage provides default
11+ options for full replay parsing so no configuration is necessary for normal use.
12+
13+ The ``configure `` function can be used to change this default configuration for
14+ all future package reads. The options, where supplied, will overwrite the
15+ default values. The ``read `` function takes a location, either file or
16+ directory, and returns a single replay or a list of replays respectively.
1417
1518::
1619
1720 import sc2reader
1821
19- #default configuration provided
2022 sc2reader.configure(**options)
2123 replay = sc2reader.read(file)
24+
25+ Alternatively, you can also pass options directly to the read function. This
26+ causes sc2reader to do a one off read with the given options, leaving the
27+ defaults unchanged.
28+
29+ ::
30+
31+ import sc2reader
2232
33+ sc2reader.read(file,**options)
34+
2335If you prefer a class based approach or want to have several different
2436configurations on hand try the above approach. Just initialize the SC2Reader
2537with the desired options (sane defaults provided) and use it just like you
@@ -34,31 +46,39 @@ of the documentation will use this class based approach.
3446 reader = SC2Reader(**options)
3547 replay = reader.read(file)
3648
37- These two top level interfaces should remain fairly stable in the near to mid
49+ These three top level interfaces should remain fairly stable in the near to mid
3850future.
3951
4052
4153Options
4254-----------
4355
4456SC2Reader behavior can be configured with a number of options which can either
45- be specified individually by keyword argument or packaged into a dictionary::
57+ be specified individually by keyword argument or packaged into a dictionary.
4658
47- import sc2reader
59+ ::
60+
61+ import sc2reader
62+ from sc2reader import SC2Reader, PARTIAL
4863
64+ #Its often cleaner to package the options into a dict first
4965 options = dict(
50- ' processors': [PostProcessor ],
51- ' parse': sc2reader. PARTIAL,
52- ' directory': 'C:\Users\Me\Documents...',
66+ processors=[ExamplePostProcessor ],
67+ parse= PARTIAL,
68+ directory= 'C:\Users\Me\Documents...',
5369 )
54-
55- reader = SC2Reader(processors=[PostProcessor],parse=sc2reader.PARTIAL)
56- sc2reader.config(**options)
57-
70+
71+ #The various different configuration methods
72+ reader = SC2Reader(processors=[PostProcessor],parse=PARTIAL)
73+ sc2reader.read(location,**options)
74+ sc2reader.configure(**options)
75+
5876Options currently available are described below:
5977
6078.. option :: processors
6179
80+ *Default: [] *
81+
6282 Specifies a list of processors to apply to the replay object after it is
6383 constructed but before it is returned::
6484
@@ -75,11 +95,15 @@ Options currently available are described below:
7595
7696.. option :: directory
7797
98+ *Default: "" *
99+
78100 Specifies the directory in which the files to be read reside (defaults to
79101 None). Does a basic `os.path.join ` with the file names as passed in.
80102
81103.. option :: parse
82104
105+ *Default: FULL *
106+
83107 Three parse levels are provided for general convenience:
84108
85109 * ``FULL `` parse will parse through all available files and produce the
@@ -89,4 +113,9 @@ Options currently available are described below:
89113 * ``CUSTOM `` parse allows a user with intimate knowledge of sc2reader to
90114 hand build their own parse style.
91115
92-
116+ .. option :: verbose
117+
118+ *Default: False *
119+
120+ The verbose option can be used to get a detailed readout of the replay
121+ parsing progress. **Experimental Option **
0 commit comments