Skip to content

Commit 77fa284

Browse files
committed
Integrate Black for code formatting
1 parent d0b241d commit 77fa284

30 files changed

+959
-590
lines changed

docs/source/conf.py

+73-57
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
# If extensions (or modules to document with autodoc) are in another directory,
1919
# add these directories to sys.path here. If the directory is relative to the
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#sys.path.insert(0, os.path.abspath('.'))
21+
# sys.path.insert(0, os.path.abspath('.'))
2222

2323
# -- General configuration ------------------------------------------------
2424

2525
# If your documentation needs a minimal Sphinx version, state it here.
26-
#needs_sphinx = '1.0'
26+
# needs_sphinx = '1.0'
2727

2828
# Add any Sphinx extension module names here, as strings. They can be
2929
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -36,7 +36,7 @@
3636
'sphinx.ext.todo',
3737
'sphinx.ext.coverage',
3838
'sphinx.ext.imgmath',
39-
'sphinx.ext.ifconfig'
39+
'sphinx.ext.ifconfig',
4040
]
4141

4242
autodoc_default_options = {
@@ -52,7 +52,7 @@
5252
source_suffix = '.rst'
5353

5454
# The encoding of source files.
55-
#source_encoding = 'utf-8-sig'
55+
# source_encoding = 'utf-8-sig'
5656

5757
# The master toctree document.
5858
master_doc = 'index'
@@ -72,13 +72,13 @@
7272

7373
# The language for content autogenerated by Sphinx. Refer to documentation
7474
# for a list of supported languages.
75-
#language = None
75+
# language = None
7676

7777
# There are two options for replacing |today|: either, you set today to some
7878
# non-false value, then it is used:
79-
#today = ''
79+
# today = ''
8080
# Else, today_fmt is used as the format for a strftime call.
81-
#today_fmt = '%B %d, %Y'
81+
# today_fmt = '%B %d, %Y'
8282

8383
# List of patterns, relative to source directory, that match files and
8484
# directories to ignore when looking for source files.
@@ -89,24 +89,24 @@
8989
default_role = 'any'
9090

9191
# If true, '()' will be appended to :func: etc. cross-reference text.
92-
#add_function_parentheses = True
92+
# add_function_parentheses = True
9393

9494
# If true, the current module name will be prepended to all description
9595
# unit titles (such as .. function::).
96-
#add_module_names = True
96+
# add_module_names = True
9797

9898
# If true, sectionauthor and moduleauthor directives will be shown in the
9999
# output. They are ignored by default.
100-
#show_authors = False
100+
# show_authors = False
101101

102102
# The name of the Pygments (syntax highlighting) style to use.
103103
pygments_style = 'sphinx'
104104

105105
# A list of ignored prefixes for module index sorting.
106-
#modindex_common_prefix = []
106+
# modindex_common_prefix = []
107107

108108
# If true, keep warnings as "system message" paragraphs in the built documents.
109-
#keep_warnings = False
109+
# keep_warnings = False
110110

111111

112112
# -- Options for HTML output ----------------------------------------------
@@ -118,17 +118,17 @@
118118
# Theme options are theme-specific and customize the look and feel of a theme
119119
# further. For a list of options available for each theme, see the
120120
# documentation.
121-
#html_theme_options = {}
121+
# html_theme_options = {}
122122

123123
# Add any paths that contain custom themes here, relative to this directory.
124-
#html_theme_path = []
124+
# html_theme_path = []
125125

126126
# The name for this set of Sphinx documents. If None, it defaults to
127127
# "<project> v<release> documentation".
128-
#html_title = None
128+
# html_title = None
129129

130130
# A shorter title for the navigation bar. Default is the same as html_title.
131-
#html_short_title = None
131+
# html_short_title = None
132132

133133
# The name of an image file (relative to this directory) to place at the top
134134
# of the sidebar.
@@ -137,7 +137,7 @@
137137
# The name of an image file (within the static path) to use as favicon of the
138138
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
139139
# pixels large.
140-
#html_favicon = None
140+
# html_favicon = None
141141

142142
# Add any paths that contain custom static files (such as style sheets) here,
143143
# relative to this directory. They are copied after the builtin static files,
@@ -147,48 +147,48 @@
147147
# Add any extra paths that contain custom files (such as robots.txt or
148148
# .htaccess) here, relative to this directory. These files are copied
149149
# directly to the root of the documentation.
150-
#html_extra_path = []
150+
# html_extra_path = []
151151

152152
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
153153
# using the given strftime format.
154-
#html_last_updated_fmt = '%b %d, %Y'
154+
# html_last_updated_fmt = '%b %d, %Y'
155155

156156
# If true, SmartyPants will be used to convert quotes and dashes to
157157
# typographically correct entities.
158-
#html_use_smartypants = True
158+
# html_use_smartypants = True
159159

160160
# Custom sidebar templates, maps document names to template names.
161-
#html_sidebars = {}
161+
# html_sidebars = {}
162162

163163
# Additional templates that should be rendered to pages, maps page names to
164164
# template names.
165-
#html_additional_pages = {}
165+
# html_additional_pages = {}
166166

167167
# If false, no module index is generated.
168-
#html_domain_indices = True
168+
# html_domain_indices = True
169169

170170
# If false, no index is generated.
171-
#html_use_index = True
171+
# html_use_index = True
172172

173173
# If true, the index is split into individual pages for each letter.
174-
#html_split_index = False
174+
# html_split_index = False
175175

176176
# If true, links to the reST sources are added to the pages.
177-
#html_show_sourcelink = True
177+
# html_show_sourcelink = True
178178

179179
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
180-
#html_show_sphinx = True
180+
# html_show_sphinx = True
181181

182182
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
183-
#html_show_copyright = True
183+
# html_show_copyright = True
184184

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

190190
# This is the file name suffix for HTML files (e.g. ".xhtml").
191-
#html_file_suffix = None
191+
# html_file_suffix = None
192192

193193
# Output file base name for HTML help builder.
194194
htmlhelp_basename = 'osBraindoc'
@@ -197,56 +197,64 @@
197197
# -- Options for LaTeX output ---------------------------------------------
198198

199199
latex_elements = {
200-
# The paper size ('letterpaper' or 'a4paper').
201-
#'papersize': 'letterpaper',
202-
203-
# The font size ('10pt', '11pt' or '12pt').
204-
#'pointsize': '10pt',
205-
206-
# Additional stuff for the LaTeX preamble.
207-
#'preamble': '',
200+
# The paper size ('letterpaper' or 'a4paper').
201+
#'papersize': 'letterpaper',
202+
# The font size ('10pt', '11pt' or '12pt').
203+
#'pointsize': '10pt',
204+
# Additional stuff for the LaTeX preamble.
205+
#'preamble': '',
208206
}
209207

210208
# Grouping the document tree into LaTeX files. List of tuples
211209
# (source start file, target name, title,
212210
# author, documentclass [howto, manual, or own class]).
213211
latex_documents = [
214-
('index', 'osBrain.tex', u'osBrain Documentation',
215-
u'Open Sistemas de Información Internet S.L.', 'manual'),
212+
(
213+
'index',
214+
'osBrain.tex',
215+
u'osBrain Documentation',
216+
u'Open Sistemas de Información Internet S.L.',
217+
'manual',
218+
)
216219
]
217220

218221
# The name of an image file (relative to this directory) to place at the top of
219222
# the title page.
220-
#latex_logo = None
223+
# latex_logo = None
221224

222225
# For "manual" documents, if this is true, then toplevel headings are parts,
223226
# not chapters.
224-
#latex_use_parts = False
227+
# latex_use_parts = False
225228

226229
# If true, show page references after internal links.
227-
#latex_show_pagerefs = False
230+
# latex_show_pagerefs = False
228231

229232
# If true, show URL addresses after external links.
230-
#latex_show_urls = False
233+
# latex_show_urls = False
231234

232235
# Documents to append as an appendix to all manuals.
233-
#latex_appendices = []
236+
# latex_appendices = []
234237

235238
# If false, no module index is generated.
236-
#latex_domain_indices = True
239+
# latex_domain_indices = True
237240

238241

239242
# -- Options for manual page output ---------------------------------------
240243

241244
# One entry per manual page. List of tuples
242245
# (source start file, name, description, authors, manual section).
243246
man_pages = [
244-
('index', 'osBrain', u'osBrain Documentation',
245-
[u'Open Sistemas de Información Internet S.L.'], 1)
247+
(
248+
'index',
249+
'osBrain',
250+
u'osBrain Documentation',
251+
[u'Open Sistemas de Información Internet S.L.'],
252+
1,
253+
)
246254
]
247255

248256
# If true, show URL addresses after external links.
249-
#man_show_urls = False
257+
# man_show_urls = False
250258

251259

252260
# -- Options for Texinfo output -------------------------------------------
@@ -255,22 +263,28 @@
255263
# (source start file, target name, title, author,
256264
# dir menu entry, description, category)
257265
texinfo_documents = [
258-
('index', 'osBrain', u'osBrain Documentation',
259-
u'Open Sistemas de Información Internet S.L.', 'osBrain', 'One line description of project.',
260-
'Miscellaneous'),
266+
(
267+
'index',
268+
'osBrain',
269+
u'osBrain Documentation',
270+
u'Open Sistemas de Información Internet S.L.',
271+
'osBrain',
272+
'One line description of project.',
273+
'Miscellaneous',
274+
)
261275
]
262276

263277
# Documents to append as an appendix to all manuals.
264-
#texinfo_appendices = []
278+
# texinfo_appendices = []
265279

266280
# If false, no module index is generated.
267-
#texinfo_domain_indices = True
281+
# texinfo_domain_indices = True
268282

269283
# How to display URL addresses: 'footnote', 'no', or 'inline'.
270-
#texinfo_show_urls = 'footnote'
284+
# texinfo_show_urls = 'footnote'
271285

272286
# If true, do not generate a @detailmenu in the "Top" node's menu.
273-
#texinfo_no_detailmenu = False
287+
# texinfo_no_detailmenu = False
274288

275289

276290
class MyPythonDomain(PythonDomain):
@@ -281,7 +295,9 @@ def find_obj(self, env, modname, classname, name, type, searchmode=0):
281295
282296
See: https://github.com/sphinx-doc/sphinx/issues/3866
283297
"""
284-
orig_matches = PythonDomain.find_obj(self, env, modname, classname, name, type, searchmode)
298+
orig_matches = PythonDomain.find_obj(
299+
self, env, modname, classname, name, type, searchmode
300+
)
285301
matches = []
286302
for match in orig_matches:
287303
match_name = match[0]

examples/dispatcher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def request_work(agent):
3434
worker = run_agent('Worker%s' % i)
3535
worker.connect(results_addr, alias='results')
3636
worker.connect(dispatcher_addr, alias='dispatcher')
37-
worker.each(0., request_work)
37+
worker.each(0.0, request_work)
3838

3939
while len(ns.agents()) > 2:
4040
time.sleep(0.1)

osbrain/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Pyro4.config.THREADPOOL_SIZE = 16
1111
Pyro4.config.SERVERTYPE = 'thread'
1212
Pyro4.config.REQUIRE_EXPOSE = False
13-
Pyro4.config.COMMTIMEOUT = 0.
13+
Pyro4.config.COMMTIMEOUT = 0.0
1414
Pyro4.config.DETAILED_TRACEBACK = True
1515

1616
config = {}
@@ -24,8 +24,9 @@
2424
else:
2525
config['TRANSPORT'] = os.environ.get('OSBRAIN_DEFAULT_TRANSPORT', 'ipc')
2626
# Set storage folder for IPC socket files
27-
config['IPC_DIR'] = \
27+
config['IPC_DIR'] = (
2828
Path(os.environ.get('XDG_RUNTIME_DIR', Path.home())) / '.osbrain_ipc'
29+
)
2930
config['IPC_DIR'].mkdir(exist_ok=True, parents=True)
3031

3132

0 commit comments

Comments
 (0)