Skip to content

Commit

Permalink
chore: format code with black and isort.
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Aug 10, 2021
1 parent 359d97c commit f70b9cf
Show file tree
Hide file tree
Showing 368 changed files with 3,755 additions and 504 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ lock:
pipenv lock --requirements > requirements.txt
pipenv lock --requirements --dev > requirements-dev.txt
.PHONY: lock

format:
isort .
black --required-version 21.7b0 .
.PHONY: format
71 changes: 37 additions & 34 deletions docs/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import sys

# Insert py-stellar-base's Path for Autodoc
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# -- General configuration ------------------------------------------------

Expand All @@ -33,33 +33,34 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints'
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
]

intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'py-stellar-base'
copyright = '2019, StellarCN and Individual Contributors'
author = 'StellarCN and Individual Contributors'
project = "py-stellar-base"
copyright = "2019, StellarCN and Individual Contributors"
author = "StellarCN and Individual Contributors"

import stellar_sdk

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand All @@ -74,15 +75,15 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -92,16 +93,13 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'collapse_navigation': False,
'style_external_links': False
}
html_theme_options = {"collapse_navigation": False, "style_external_links": False}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -131,23 +129,20 @@
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'py-stellar-base-doc'
htmlhelp_basename = "py-stellar-base-doc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -157,26 +152,34 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'py-stellar-base.tex', 'py-stellar-base Documentation',
'Stellar Community', 'manual'),
(
master_doc,
"py-stellar-base.tex",
"py-stellar-base Documentation",
"Stellar Community",
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pystellar', 'py-stellar-base Documentation',
[author], 1)
]
man_pages = [(master_doc, "pystellar", "py-stellar-base Documentation", [author], 1)]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'py-stellar-base', 'py-stellar-base Documentation',
author, 'py-stellar-base', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"py-stellar-base",
"py-stellar-base Documentation",
author,
"py-stellar-base",
"One line description of project.",
"Miscellaneous",
),
]
71 changes: 37 additions & 34 deletions docs/zh_CN/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import sys

# Insert py-stellar-base's Path for Autodoc
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# -- General configuration ------------------------------------------------

Expand All @@ -33,33 +33,34 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints'
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
]

intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'py-stellar-base'
copyright = '2019, StellarCN and Individual Contributors'
author = 'StellarCN and Individual Contributors'
project = "py-stellar-base"
copyright = "2019, StellarCN and Individual Contributors"
author = "StellarCN and Individual Contributors"

import stellar_sdk

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand All @@ -74,15 +75,15 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'zh_CN'
language = "zh_CN"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -92,16 +93,13 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'collapse_navigation': False,
'style_external_links': False
}
html_theme_options = {"collapse_navigation": False, "style_external_links": False}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -131,23 +129,20 @@
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'py-stellar-base-doc'
htmlhelp_basename = "py-stellar-base-doc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -157,26 +152,34 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'py-stellar-base.tex', 'py-stellar-base Documentation',
'Stellar Community', 'manual'),
(
master_doc,
"py-stellar-base.tex",
"py-stellar-base Documentation",
"Stellar Community",
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pystellar', 'py-stellar-base Documentation',
[author], 1)
]
man_pages = [(master_doc, "pystellar", "py-stellar-base Documentation", [author], 1)]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'py-stellar-base', 'py-stellar-base Documentation',
author, 'py-stellar-base', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"py-stellar-base",
"py-stellar-base Documentation",
author,
"py-stellar-base",
"One line description of project.",
"Miscellaneous",
),
]
2 changes: 1 addition & 1 deletion examples/account_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
See: https://developers.stellar.org/docs/start/list-of-operations/#account-merge
"""
from stellar_sdk import Server, Keypair, TransactionBuilder, Network
from stellar_sdk import Keypair, Network, Server, TransactionBuilder

# Configure StellarSdk to talk to the horizon instance hosted by Stellar.org
# To use the live network, set the hostname to 'horizon.stellar.org'
Expand Down
2 changes: 1 addition & 1 deletion examples/build_fee_bump_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""
import pprint

from stellar_sdk import Keypair, Server, TransactionBuilder, Network
from stellar_sdk import Keypair, Network, Server, TransactionBuilder
from stellar_sdk.exceptions import BadRequestError

horizon_url = "https://horizon-testnet.stellar.org/"
Expand Down
10 changes: 5 additions & 5 deletions examples/claimable_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
See: https://developers.stellar.org/docs/glossary/claimable-balance/
"""
from stellar_sdk import (
Server,
TransactionBuilder,
Keypair,
ClaimPredicate,
Claimant,
Asset,
Claimant,
ClaimPredicate,
Keypair,
Network,
Server,
TransactionBuilder,
)

sponsor_secret = "SAOJHTVFCYVKUMPNQI7RUSI566GKWXP7RXOHP4SV6JAVUQKSIWGPZFPJ"
Expand Down
8 changes: 4 additions & 4 deletions examples/clawback.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# Configure StellarSdk to talk to the horizon instance hosted by Stellar.org
# To use the live network, set the hostname to 'horizon.stellar.org'
from stellar_sdk import (
Server,
Keypair,
Asset,
TransactionBuilder,
Network,
AuthorizationFlag,
Keypair,
Network,
Server,
TransactionBuilder,
)

server = Server(horizon_url="https://horizon-testnet.stellar.org")
Expand Down
2 changes: 1 addition & 1 deletion examples/create_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
See: https://developers.stellar.org/docs/tutorials/create-account/#create-account
See: https://developers.stellar.org/docs/start/list-of-operations/#create-account
"""
from stellar_sdk import TransactionBuilder, Server, Network, Keypair
from stellar_sdk import Keypair, Network, Server, TransactionBuilder

server = Server(horizon_url="https://horizon-testnet.stellar.org")
source = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD")
Expand Down
Loading

0 comments on commit f70b9cf

Please sign in to comment.