Skip to content

Commit 3f1f26a

Browse files
committed
New engine
2 parents 6b1f206 + c1fd243 commit 3f1f26a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3884
-2357
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ language: python
22
python:
33
- 2.6
44
- 2.7
5+
- 3.2
6+
- 3.3
57
- pypy
68
install:
79
- python setup.py install
10+
- pip install coveralls
811
script:
9-
- py.test test_replays test_s2gs
12+
- coverage run test_replays/test_all.py
13+
- coverage run --append test_s2gs/test_all.py
14+
after_success:
15+
- coveralls
16+
branches:
17+
only:
18+
- master
1019
notifications:
1120
irc: "chat.freenode.net#sc2reader"

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ CHANGELOG
44
0.5.2 -
55
--------------------
66

7+
* Adds experimental SC2Map.MapInfo parsing support. Replaces the useless MapInfo resource from before.
8+
* Summary.teams is now summary.team; summary.team is now summary.teams. To conform with replay name conventions
9+
* Fixed #136, unit types from tracker events are used when available.
10+
* Deprecated player.gateway for player.region
11+
* Reorganized the person/player/observer hierarchy. Top level classes are now Computer, Participant, and Observer. Participant and Computer are both children of player so any isinstance code should still work fine.
12+
* Player.uid now means something completely different! Use player.toon_id instead
13+
* Player.uid is now the user id of the player (was player.cid)
14+
* PersonDict can no longer be constructed from a player list and new players cannot be added by string (name). Only integer keys accepted for setting.
15+
* Added a sc2json script contributed by @ChrisLundquist
716
* Hooked up travis-ci for continuous testing. https://travis-ci.org/GraylinKim/sc2reader
17+
* Switched to built in python unittest module for testing.
818
* Log a warning instead of throwing an exception when using an unknown colors.
919
* An unknown hex value will use the hex value as the name.
1020
* An unknown color name will use 0x000000 as the color.
1121

22+
1223
0.5.1 - June 1, 2013
1324
--------------------
1425

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ description of the information that can be extracted please consult the
4545
`documentation`_ hosted on Read the Docs.
4646

4747
The library is production ready and reasonably stable. `travis-ci`_ provides a
48-
record of continuous testing which you can `see here`_
48+
record of our `continuous testing`_ and `coveralls.io`_ provides a record of our `test coverage`_.
4949

5050

5151
Replays
@@ -244,16 +244,14 @@ too much work. It'll make everyone happier in the long run.
244244
Testing
245245
-------------------
246246

247-
We use py.test for testing. You can install it via pip/easy_install::
248-
249-
pip install pytest
250-
easy_install pytest
247+
We use the built in ``unittest`` module for testing. If you are still on Python
248+
2.6 you will need to install ``unittest2`` because our test suite requires newer
249+
features than are included in the main distribution.
251250

252251
To run the tests just use::
253252

254-
py.test # Runs all the tests
255-
py.test test_replays # Only run tests on replays
256-
py.test test_s2gs # Only run tests on summary files
253+
python -m unittest discover test_replays
254+
python -m unittest discover test_s2gs
257255

258256
When repeatedly running tests it can be very helpful to make sure you've
259257
set a local cache directory to prevent long fetch times from battle.net::
@@ -322,5 +320,7 @@ and kept this project going.
322320
.. _issue tracker: https://github.com/GraylinKim/sc2reader/issues
323321
.. _bnet_scraper: https://github.com/agoragames/bnet_scraper
324322
.. _sc2profile: https://github.com/srounet/sc2profile
325-
.. _see here: https://travis-ci.org/GraylinKim/sc2reader
323+
.. _continuous testing: https://travis-ci.org/GraylinKim/sc2reader
326324
.. _travis-ci: https://travis-ci.org/
325+
.. _coveralls.io: https://coveralls.io
326+
.. _test coverage: https://coveralls.io/r/GraylinKim/sc2reader

STYLE_GUIDE.rst

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
11
STYLE GUIDE
22
==============
33

4-
Use your common sense and have some decency. Also try to stick to the following where reasonable.
4+
As a rough style guide, please lint your code with pep8::
55

6+
pip install pep8
7+
pep8 --ignore E501,E226,E241 sc2reader
68

7-
Absolute Imports
8-
----------------------
99

10-
Always use absolute imports::
10+
All files should start with the following::
1111

12-
from __future__ import absolute_import
12+
# -*- coding: utf-8 -*-
13+
#
14+
# Optional Documentation on the module
15+
#
16+
from __future__ import absolute_import, print_function, unicode_literals, division
1317

14-
That means imports should always start with sc2reader... instead of being relative to the current module.
18+
All imports should be absolute.
1519

16-
from sc2reader.utils import ReplayBuffer
1720

21+
All string formatting sound be done in the following style::
1822

19-
Explicit Imports
20-
---------------------
23+
"my {0} formatted {1} string {2}".format("super", "python", "example")
24+
"the {x} style of {y} is also {z}".format(x="dict", y="arguments", z="acceptable")
2125

22-
Prefer explicit imports to globbed imports
23-
24-
from sc2reader.events import ChatEvent
25-
26-
is better than
27-
28-
from sc2reader.events import *
29-
30-
31-
Formatting Strings
32-
-----------------------
33-
34-
Use string.format(args) instead string % (args).
35-
36-
To support python 2.6, use numerical indexes even though it is a pain in the ass::
37-
38-
"{0} minerals, {1} gas, {2} terrazine, and {3} custom".format(self.minerals, self.vespene, self.terrazine, self.custom)
26+
The format argument index numbers are important for 2.6 support. ``%`` formatting is not allowed for 3.x support
3927

docs/source/mainobjects.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,3 @@ Game Summary
2424
.. autoclass:: GameSummary
2525
:members:
2626

27-
MapInfo
28-
---------------
29-
30-
.. autoclass:: MapInfo
31-
:members:
32-
33-
MapHeader
34-
---------------
35-
36-
.. autoclass:: MapHeader
37-
:members:

docs/source/supportobjects.rst

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,69 @@ Support Structures
66
These dumb data structures help to give meaningful organization and structure to the information in their respective parent resources.
77

88

9+
Entity
10+
------------------
11+
12+
.. autoclass:: Entity
13+
:members:
14+
915
Player
1016
------------------
1117

1218
.. autoclass:: Player
1319
:members:
1420

21+
User
22+
------------------
23+
24+
.. autoclass:: User
25+
:members:
1526

1627
Observer
17-
---------------
28+
------------------
1829

1930
.. autoclass:: Observer
2031
:members:
2132

33+
Computer
34+
------------------
2235

23-
Person
24-
-------------
36+
.. autoclass:: Computer
37+
:members:
2538

26-
.. autoclass:: Person
27-
:members:
39+
Participant
40+
------------------
2841

42+
.. autoclass:: Participant
43+
:members:
2944

3045
Team
31-
----------------
46+
------------------
3247

3348
.. autoclass:: Team
3449
:members:
3550

3651

3752
PlayerSummary
38-
-----------------
53+
------------------
3954

4055
.. autoclass:: PlayerSummary
4156
:members:
4257

4358
Graph
44-
-----------
59+
------------------
4560

4661
.. autoclass:: Graph
4762
:members:
63+
64+
MapInfo
65+
------------------
66+
67+
.. autoclass:: MapInfo
68+
:members:
69+
70+
MapInfoPlayer
71+
------------------
72+
73+
.. autoclass:: MapInfoPlayer
74+
:members:

0 commit comments

Comments
 (0)