Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Oct 26, 2022
1 parent 22e13e7 commit 3d2a460
Show file tree
Hide file tree
Showing 56 changed files with 1,313 additions and 914 deletions.
142 changes: 76 additions & 66 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,33 @@
import os
from unittest import mock

MOCK_MODULES = ['numpy', 'scipy', 'tables',
'sapphire', 'sapphire.utils', 'sapphire.storage',
'sapphire.transformations', 'sapphire.analysis',
'sapphire.analysis.event_utils',
'sapphire.analysis.calibration']
MOCK_MODULES = [
'numpy',
'scipy',
'tables',
'sapphire',
'sapphire.utils',
'sapphire.storage',
'sapphire.transformations',
'sapphire.analysis',
'sapphire.analysis.event_utils',
'sapphire.analysis.calibration',
]
sys.modules.update((name, mock.MagicMock()) for name in MOCK_MODULES)

# The directory that contains settings_develop.py
sys.path.append(os.path.abspath('../publicdb'))

# Set up the Django settings/environment
import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "publicdb.settings_develop")
django.setup()

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

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
Expand All @@ -42,7 +50,7 @@
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
Expand All @@ -62,37 +70,37 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# default_role = None

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

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# show_authors = False

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

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# modindex_common_prefix = []


# -- Options for HTML output ---------------------------------------------------
Expand All @@ -104,17 +112,17 @@
# 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 = {}
# html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# html_theme_path = []

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

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand All @@ -132,69 +140,68 @@

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

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True
# html_domain_indices = True

# If false, no index is generated.
#html_use_index = True
# html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False
# html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# html_show_sphinx = True

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

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

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

# Output file base name for HTML help builder.
htmlhelp_basename = 'publicdbdoc'


def setup(app):
app.add_css_file('hisparc_style.css')


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

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

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

# Additional stuff for the LaTeX preamble.
#'preamble': '',
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4',
# The font size ('10pt', '11pt' or '12pt').
'pointsize': '11pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'publicdb.tex', 'Public Database Documentation',
'Arne de Laat', 'manual'),
('index', 'publicdb.tex', 'Public Database Documentation', 'Arne de Laat', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand All @@ -203,32 +210,29 @@ def setup(app):

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True
# latex_domain_indices = True


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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'publicdb', 'Public Database Documentation',
['Arne de Laat'], 1)
]
man_pages = [('index', 'publicdb', 'Public Database Documentation', ['Arne de Laat'], 1)]

# If true, show URL addresses after external links.
#man_show_urls = False
# man_show_urls = False


# -- Options for Texinfo output ------------------------------------------------
Expand All @@ -237,19 +241,25 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'publicdb', 'Public Database Documentation',
'Arne de Laat', 'publicdb', 'One line description of project.',
'Miscellaneous'),
(
'index',
'publicdb',
'Public Database Documentation',
'Arne de Laat',
'publicdb',
'One line description of project.',
'Miscellaneous',
),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# texinfo_show_urls = 'footnote'


# -- Options for Epub output ---------------------------------------------------
Expand All @@ -262,37 +272,37 @@ def setup(app):

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''
# epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# epub_cover = ()

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# epub_post_files = []

# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
# epub_exclude_files = []

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True
# epub_tocdup = True


# -- User-defined options ------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
CFG_URL = '{{ datastore_config_url }}'
RELOAD_PATH = '/tmp/uwsgi-reload.me'


def reload_datastore():
"""Load datastore config and reload datastore, if necessary"""

Expand Down Expand Up @@ -55,8 +56,7 @@ class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)

# Create server
server = SimpleXMLRPCServer(('{{ datastore_host }}', {{ datastore_port }}),
requestHandler=RequestHandler)
server = SimpleXMLRPCServer(('{{ datastore_host }}', {{datastore_port}}), requestHandler=RequestHandler)
server.register_introspection_functions()

server.register_function(reload_datastore)
Expand Down
2 changes: 1 addition & 1 deletion provisioning/roles/datastore/templates/writer_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

from writer import writer_app

configfile = ('{{ datastore_path }}config.ini')
configfile = '{{ datastore_path }}config.ini'
writer_app.writer(configfile)
7 changes: 2 additions & 5 deletions provisioning/roles/publicdb/templates/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',

'publicdb.inforecords',
'publicdb.histograms',
'publicdb.coincidences',
Expand All @@ -153,15 +152,13 @@
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
'class': 'django.utils.log.AdminEmailHandler',
},
'null_handler': {
'class': 'logging.NullHandler',
Expand Down
Loading

0 comments on commit 3d2a460

Please sign in to comment.