Skip to content

Commit a45fc3e

Browse files
committed
Restyle all code in py-toxcore-c.
This makes some code uglier, but at least we don't need to worry about formatting anymore.
1 parent 5b3c4fd commit a45fc3e

File tree

17 files changed

+1765
-2021
lines changed

17 files changed

+1765
-2021
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ test: kill build
1515

1616
echobot: kill build
1717
docker run -t --name pytox pytox_image python PyTox/examples/echo.py
18-

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Docker hub: <https://hub.docker.com/r/toxchat/py-toxcore-c/>
1111
docker pull toxchat/py-toxcore-c
1212
```
1313

14-
PyTox provides a Pythonic binding, i.e Object-oriented instead of C
15-
style, raise exception instead of returning error code. A simple example
16-
is as follows:
14+
PyTox provides a Pythonic binding, i.e Object-oriented instead of C style, raise
15+
exception instead of returning error code. A simple example is as follows:
1716

1817
```python
1918
from pytox import Tox
@@ -57,36 +56,32 @@ class EchoBot(Tox):
5756
EchoBot(ToxOptions()).loop()
5857
```
5958

60-
As you can see callbacks are mapped into class method instead of using
61-
it the the c ways. For more details please refer to
59+
As you can see callbacks are mapped into class method instead of using it the
60+
the c ways. For more details please refer to
6261
[examples/echo.py](https://github.com/TokTok/py-toxcore-c/blob/master/examples/echo.py).
6362

6463
## Getting started
6564

66-
To get started, a Makefile is provided to run PyTox inside a docker
67-
container:
65+
To get started, a Makefile is provided to run PyTox inside a docker container:
6866

69-
- `make test`: This will launch tests in a container.
70-
- `make run`: This will launch an interactive container with PyTox
71-
installed.
72-
- `make echobot`: This will launch the example echobot in a
73-
container.
67+
- `make test`: This will launch tests in a container.
68+
- `make run`: This will launch an interactive container with PyTox installed.
69+
- `make echobot`: This will launch the example echobot in a container.
7470

7571
## Examples
7672

77-
- [echo.py](https://github.com/TokTok/py-toxcore-c/blob/master/examples/echo.py):
78-
A working echo bot that wait for friend requests, and than start
79-
echoing anything that friend send.
73+
- [echo.py](https://github.com/TokTok/py-toxcore-c/blob/master/examples/echo.py):
74+
A working echo bot that wait for friend requests, and than start echoing
75+
anything that friend send.
8076

8177
## Documentation
8278

83-
Full API documentation can be read
84-
[here](http://aitjcize.github.io/PyTox/).
79+
Full API documentation can be read [here](http://aitjcize.github.io/PyTox/).
8580

8681
## Todo
8782

88-
- Complete API binding (use tools/apicomplete.py to check)
89-
- Unittest for ToxAV
83+
- Complete API binding (use tools/apicomplete.py to check)
84+
- Unittest for ToxAV
9085

9186
## Contributing
9287

docs/conf.py

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,236 +10,237 @@
1010
#
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
13+
import os
14+
import sys
1315

14-
import sys, os
15-
16-
sys.path.insert(0, os.popen('git rev-parse --show-toplevel 2> /dev/null').read().strip())
17-
16+
sys.path.insert(
17+
0,
18+
os.popen("git rev-parse --show-toplevel 2> /dev/null").read().strip())
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,
2021
# add these directories to sys.path here. If the directory is relative to the
2122
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
#sys.path.insert(0, os.path.abspath('.'))
23+
# sys.path.insert(0, os.path.abspath('.'))
2324

2425
# -- General configuration -----------------------------------------------------
2526

2627
# If your documentation needs a minimal Sphinx version, state it here.
27-
#needs_sphinx = '1.0'
28+
# needs_sphinx = '1.0'
2829

2930
# Add any Sphinx extension module names here, as strings. They can be extensions
3031
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
31-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage']
32+
extensions = [
33+
"sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.coverage"
34+
]
3235

3336
# Add any paths that contain templates here, relative to this directory.
34-
templates_path = ['_templates']
37+
templates_path = ["_templates"]
3538

3639
# The suffix of source filenames.
37-
source_suffix = '.rst'
40+
source_suffix = ".rst"
3841

3942
# The encoding of source files.
40-
#source_encoding = 'utf-8-sig'
43+
# source_encoding = 'utf-8-sig'
4144

4245
# The master toctree document.
43-
master_doc = 'index'
46+
master_doc = "index"
4447

4548
# General information about the project.
46-
project = u'PyTox'
47-
copyright = u'2013, Wei-Ning Huang'
49+
project = u"PyTox"
50+
copyright = u"2013, Wei-Ning Huang"
4851

4952
# The version info for the project you're documenting, acts as replacement for
5053
# |version| and |release|, also used in various other places throughout the
5154
# built documents.
5255
#
5356
# The short X.Y version.
54-
version = '0.0.23'
57+
version = "0.0.23"
5558
# The full version, including alpha/beta/rc tags.
56-
release = '0.0.23'
59+
release = "0.0.23"
5760

5861
# The language for content autogenerated by Sphinx. Refer to documentation
5962
# for a list of supported languages.
60-
#language = None
63+
# language = None
6164

6265
# There are two options for replacing |today|: either, you set today to some
6366
# non-false value, then it is used:
64-
#today = ''
67+
# today = ''
6568
# Else, today_fmt is used as the format for a strftime call.
66-
#today_fmt = '%B %d, %Y'
69+
# today_fmt = '%B %d, %Y'
6770

6871
# List of patterns, relative to source directory, that match files and
6972
# directories to ignore when looking for source files.
70-
exclude_patterns = ['_build']
73+
exclude_patterns = ["_build"]
7174

7275
# The reST default role (used for this markup: `text`) to use for all documents.
73-
#default_role = None
76+
# default_role = None
7477

7578
# If true, '()' will be appended to :func: etc. cross-reference text.
76-
#add_function_parentheses = True
79+
# add_function_parentheses = True
7780

7881
# If true, the current module name will be prepended to all description
7982
# unit titles (such as .. function::).
80-
#add_module_names = True
83+
# add_module_names = True
8184

8285
# If true, sectionauthor and moduleauthor directives will be shown in the
8386
# output. They are ignored by default.
84-
#show_authors = False
87+
# show_authors = False
8588

8689
# The name of the Pygments (syntax highlighting) style to use.
87-
pygments_style = 'sphinx'
90+
pygments_style = "sphinx"
8891

8992
# A list of ignored prefixes for module index sorting.
90-
#modindex_common_prefix = []
91-
93+
# modindex_common_prefix = []
9294

9395
# -- Options for HTML output ---------------------------------------------------
9496

9597
# The theme to use for HTML and HTML Help pages. See the documentation for
9698
# a list of builtin themes.
97-
html_theme = 'pyramid'
99+
html_theme = "pyramid"
98100

99101
# Theme options are theme-specific and customize the look and feel of a theme
100102
# further. For a list of options available for each theme, see the
101103
# documentation.
102-
#html_theme_options = {}
104+
# html_theme_options = {}
103105

104106
# Add any paths that contain custom themes here, relative to this directory.
105-
#html_theme_path = []
107+
# html_theme_path = []
106108

107109
# The name for this set of Sphinx documents. If None, it defaults to
108110
# "<project> v<release> documentation".
109-
#html_title = None
111+
# html_title = None
110112

111113
# A shorter title for the navigation bar. Default is the same as html_title.
112-
#html_short_title = None
114+
# html_short_title = None
113115

114116
# The name of an image file (relative to this directory) to place at the top
115117
# of the sidebar.
116-
#html_logo = None
118+
# html_logo = None
117119

118120
# The name of an image file (within the static path) to use as favicon of the
119121
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
120122
# pixels large.
121-
#html_favicon = None
123+
# html_favicon = None
122124

123125
# Add any paths that contain custom static files (such as style sheets) here,
124126
# relative to this directory. They are copied after the builtin static files,
125127
# so a file named "default.css" will overwrite the builtin "default.css".
126-
html_static_path = ['_static']
128+
html_static_path = ["_static"]
127129

128130
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
129131
# using the given strftime format.
130-
#html_last_updated_fmt = '%b %d, %Y'
132+
# html_last_updated_fmt = '%b %d, %Y'
131133

132134
# If true, SmartyPants will be used to convert quotes and dashes to
133135
# typographically correct entities.
134-
#html_use_smartypants = True
136+
# html_use_smartypants = True
135137

136138
# Custom sidebar templates, maps document names to template names.
137-
#html_sidebars = {}
139+
# html_sidebars = {}
138140

139141
# Additional templates that should be rendered to pages, maps page names to
140142
# template names.
141-
#html_additional_pages = {}
143+
# html_additional_pages = {}
142144

143145
# If false, no module index is generated.
144-
#html_domain_indices = True
146+
# html_domain_indices = True
145147

146148
# If false, no index is generated.
147-
#html_use_index = True
149+
# html_use_index = True
148150

149151
# If true, the index is split into individual pages for each letter.
150-
#html_split_index = False
152+
# html_split_index = False
151153

152154
# If true, links to the reST sources are added to the pages.
153-
#html_show_sourcelink = True
155+
# html_show_sourcelink = True
154156

155157
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
156-
#html_show_sphinx = True
158+
# html_show_sphinx = True
157159

158160
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
159-
#html_show_copyright = True
161+
# html_show_copyright = True
160162

161163
# If true, an OpenSearch description file will be output, and all pages will
162164
# contain a <link> tag referring to it. The value of this option must be the
163165
# base URL from which the finished HTML is served.
164-
#html_use_opensearch = ''
166+
# html_use_opensearch = ''
165167

166168
# This is the file name suffix for HTML files (e.g. ".xhtml").
167-
#html_file_suffix = None
169+
# html_file_suffix = None
168170

169171
# Output file base name for HTML help builder.
170-
htmlhelp_basename = 'PyToxdoc'
171-
172+
htmlhelp_basename = "PyToxdoc"
172173

173174
# -- Options for LaTeX output --------------------------------------------------
174175

175176
latex_elements = {
176-
# The paper size ('letterpaper' or 'a4paper').
177-
#'papersize': 'letterpaper',
178-
179-
# The font size ('10pt', '11pt' or '12pt').
180-
#'pointsize': '10pt',
181-
182-
# Additional stuff for the LaTeX preamble.
183-
#'preamble': '',
177+
# The paper size ('letterpaper' or 'a4paper').
178+
# 'papersize': 'letterpaper',
179+
# The font size ('10pt', '11pt' or '12pt').
180+
# 'pointsize': '10pt',
181+
# Additional stuff for the LaTeX preamble.
182+
# 'preamble': '',
184183
}
185184

186185
# Grouping the document tree into LaTeX files. List of tuples
187186
# (source start file, target name, title, author, documentclass [howto/manual]).
188187
latex_documents = [
189-
('index', 'PyTox.tex', u'PyTox Documentation',
190-
u'Wei-Ning Huang', 'manual'),
188+
("index", "PyTox.tex", u"PyTox Documentation", u"Wei-Ning Huang",
189+
"manual"),
191190
]
192191

193192
# The name of an image file (relative to this directory) to place at the top of
194193
# the title page.
195-
#latex_logo = None
194+
# latex_logo = None
196195

197196
# For "manual" documents, if this is true, then toplevel headings are parts,
198197
# not chapters.
199-
#latex_use_parts = False
198+
# latex_use_parts = False
200199

201200
# If true, show page references after internal links.
202-
#latex_show_pagerefs = False
201+
# latex_show_pagerefs = False
203202

204203
# If true, show URL addresses after external links.
205-
#latex_show_urls = False
204+
# latex_show_urls = False
206205

207206
# Documents to append as an appendix to all manuals.
208-
#latex_appendices = []
207+
# latex_appendices = []
209208

210209
# If false, no module index is generated.
211-
#latex_domain_indices = True
212-
210+
# latex_domain_indices = True
213211

214212
# -- Options for manual page output --------------------------------------------
215213

216214
# One entry per manual page. List of tuples
217215
# (source start file, name, description, authors, manual section).
218-
man_pages = [
219-
('index', 'pytox', u'PyTox Documentation',
220-
[u'Wei-Ning Huang'], 1)
221-
]
216+
man_pages = [("index", "pytox", u"PyTox Documentation", [u"Wei-Ning Huang"], 1)
217+
]
222218

223219
# If true, show URL addresses after external links.
224-
#man_show_urls = False
225-
220+
# man_show_urls = False
226221

227222
# -- Options for Texinfo output ------------------------------------------------
228223

229224
# Grouping the document tree into Texinfo files. List of tuples
230225
# (source start file, target name, title, author,
231226
# dir menu entry, description, category)
232227
texinfo_documents = [
233-
('index', 'PyTox', u'PyTox Documentation',
234-
u'Wei-Ning Huang', 'PyTox', 'One line description of project.',
235-
'Miscellaneous'),
228+
(
229+
"index",
230+
"PyTox",
231+
u"PyTox Documentation",
232+
u"Wei-Ning Huang",
233+
"PyTox",
234+
"One line description of project.",
235+
"Miscellaneous",
236+
),
236237
]
237238

238239
# Documents to append as an appendix to all manuals.
239-
#texinfo_appendices = []
240+
# texinfo_appendices = []
240241

241242
# If false, no module index is generated.
242-
#texinfo_domain_indices = True
243+
# texinfo_domain_indices = True
243244

244245
# How to display URL addresses: 'footnote', 'no', or 'inline'.
245-
#texinfo_show_urls = 'footnote'
246+
# texinfo_show_urls = 'footnote'

docs/pytox.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ The pytox module contains two classes:
88

99
pytox.Tox
1010
pytox.ToxAV
11-

0 commit comments

Comments
 (0)