Skip to content

Commit

Permalink
version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qytz committed Sep 23, 2018
1 parent 660c63a commit ce06cc4
Show file tree
Hide file tree
Showing 77 changed files with 2,208 additions and 4,058 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/
*.so

# Distribution / packaging
.idea
.Python
env/
build/
Expand Down
4 changes: 4 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
==========
AUTHORS
==========

Finchan is written and maintained by qytz and
various contributors:

Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
History
=======

0.0.1 (2017-02-23)
0.1.0 (2018-09-22)
------------------

* First release on PyPI.
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
click = "*"
uvloop = "*"
python-dateutil = "*"
"ruamel.yaml" = "*"

[dev-packages]

[requires]
python_version = "3.6"
86 changes: 86 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ finchan
:alt: Updates


financial test tools with python.
Finchan event process framework with python.


* Free software: Apache License 2.0
Expand All @@ -28,4 +28,4 @@ financial test tools with python.
Features
--------

* TODO
Do whatever you want with it.
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = finchan
SOURCEDIR = source
BUILDDIR = build
SPHINXPROJ = Finchan
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11 changes: 11 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
APIS
======

.. toctree::
event
event_source
kvstore
env
dispatcher
ext_manager
timer_source
47 changes: 47 additions & 0 deletions docs/arch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
=========================
system architecture
=========================
Finchan is a event system framework,
its main modules are `Event`, `EventSource`, `Dispatcher`, `Subscribers`, `env` and `ExtManager`.

concept
=====================

The :class:`Event <finchan.event.Event>` is the input manner for `finchan`.

The :class:`EventSource <finchan.interface.event_source.AbsEventSource>`
is the original input for the system, it simulate the real world's things to `Event` as input.

The :class:`Dispatcher <finchan.dispatcher.LiveDispatcher>` is the engine of the system,
it manage all `EventSource`, all event `Subscriber`,
and dispath the events generated by `EventSource` or `Subscriber`, call the `Subscriber`'s callback.

The `Subscriber` is event subscriber, it subscriber event with a callback function,
when the event occurs, the `Dispatcher` dispatch the event and call the callback function.
The `Subscriber` can do anything with the callback function, include generate new events.

The :class:`env <finchan.env.Env>` is global environment for the system,
you can access it just by `from finchan.env import env`,
you can access environment variable setted by other modules, or set your own environment variable.

the :class:`ExtManager <finchan.exts.ExtManager>` manage all extensions for `finchan`.

Interfaces
================

kvstore
----------------
:class:`kvstore <finchan.interface.kvstore.AbsKvStore>` is persistent storage for finchan,
`finchan` framework just specified the interface for kvstore,
the implemention is done by extensions.

EventSource
----------------
The :class:`EventSource <finchan.interface.event_source.AbsEventSource>` defines the interface to
implent an EventSource, `finchan` system include a :any:`TimerSource <finchan.exts.timer_source>`,
if you need other EventSource, you should write an extension for `finchan`,
or check `finchan_exts <https://github.com/qytz/finchan_exts>`_ first.

Write an extension for finchan
==================================
refer :doc:`extend`.
1 change: 1 addition & 0 deletions docs/authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../AUTHORS.rst
88 changes: 64 additions & 24 deletions docs/source/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,25 @@
#
import os
import sys
# sys.path.insert(0, os.path.abspath('.'))
cwd = os.getcwd()
doc_root = os.path.dirname(cwd)
project_root = os.path.dirname(doc_root)
sys.path.insert(0, project_root)
sys.path.insert(0, os.path.abspath(".."))

import finchan
from finchan.__version__ import __version__ as finchan_version


# -- General configuration ------------------------------------------------
# General information about the project.
project = 'Finchan'
copyright = '2017-present, qytz'
author = 'qytz'

# 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.
#
# The short X.Y version.
version = finchan_version
# The full version, including alpha/beta/rc tags.
release = finchan_version


# If your documentation needs a minimal Sphinx version, state it here.
#
Expand All @@ -38,9 +47,11 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode']

Expand All @@ -56,20 +67,6 @@
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'finchan'
copyright = '2017, qytz'
author = 'qytz'

# 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.
#
# The short X.Y version.
version = finchan.__version__
# The full version, including alpha/beta/rc tags.
release = finchan.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand All @@ -80,7 +77,7 @@
# 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 = []
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand All @@ -91,10 +88,12 @@

# -- Options for HTML output ----------------------------------------------

# html_favicon = 'favicon.ico'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# html_theme = 'alabaster'
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
Expand All @@ -107,6 +106,16 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ------------------------------------------

Expand Down Expand Up @@ -187,3 +196,34 @@
epub_exclude_files = ['search.html']



# -- Extension configuration -------------------------------------------------

intersphinx_mapping = {
'python': ('https://docs.python.org/3.6/', None),
# 'dateutil': ('https://dateutil.readthedocs.io/', None),
}

primary_domain = 'py'
default_role = 'py:obj'

autodoc_member_order = "bysource"
autoclass_content = "both"
autodoc_inherit_docstrings = False

# Without this line sphinx includes a copy of object.__init__'s docstring
# on any class that doesn't define __init__.
# https://bitbucket.org/birkenfeld/sphinx/issue/1337/autoclass_content-both-uses-object__init__
autodoc_docstring_signature = False

coverage_skip_undoc_in_source = True
coverage_ignore_modules = []
# I wish this could go in a per-module file...
coverage_ignore_classes = []

coverage_ignore_functions = [
# various modules
"doctests",
"main",
]

1 change: 1 addition & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CONTRIBUTING.rst
19 changes: 19 additions & 0 deletions docs/dispatcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
finchan.dispatcher
======================

.. automodule:: finchan.dispatcher

Dispatcher
--------------------
.. autoclass:: BaseDispatcher
:members:

BackTrackDispatcher
--------------------
.. autoclass:: BackTrackDispatcher
:members:

LiveDispatcher
--------------------
.. autoclass:: LiveDispatcher
:members:

0 comments on commit ce06cc4

Please sign in to comment.