Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
documentation + setup + extra spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jan 17, 2015
1 parent 49efe0c commit 5397467
Show file tree
Hide file tree
Showing 41 changed files with 995 additions and 1,003 deletions.
7 changes: 4 additions & 3 deletions README.rst
@@ -1,7 +1,8 @@
.. _l-README:

README
======
.. _l-README:

README / Changes
================

**Links:**
* `pypi/pyrsslocal <https://pypi.python.org/pypi/pyrsslocal/>`_
Expand Down
3 changes: 1 addition & 2 deletions _doc/sphinxdoc/source/conf.py
Expand Up @@ -23,5 +23,4 @@
"hachibee",
hachibee_sphinx_theme.get_html_themes_path(),
locals(),
add_extensions = ['hachibee_sphinx_theme'])

add_extensions = ['hachibee_sphinx_theme'])
39 changes: 12 additions & 27 deletions _doc/sphinxdoc/source/index.rst
Expand Up @@ -95,36 +95,21 @@ Functionalities


Indices and tables
==================

+------------------+---------------------+------------------+------------------+------------------------+---------------------+
| :ref:`l-modules` | :ref:`l-functions` | :ref:`l-classes` | :ref:`l-methods` | :ref:`l-staticmethods` | :ref:`l-properties` |
+------------------+---------------------+------------------+------------------+------------------------+---------------------+
| :ref:`genindex` | :ref:`modindex` | :ref:`search` | :ref:`l-license` | :ref:`l-changes` | :ref:`l-README` |
+------------------+---------------------+------------------+------------------+------------------------+---------------------+
| :ref:`l-example` | :ref:`l-FAQ` | | | | |
+------------------+---------------------+------------------+------------------+------------------------+---------------------+
------------------

+----------------------+---------------------+---------------------+--------------------+------------------------+------------------------------------------------+
| :ref:`l-modules` | :ref:`l-functions` | :ref:`l-classes` | :ref:`l-methods` | :ref:`l-staticmethods` | :ref:`l-properties` |
+----------------------+---------------------+---------------------+--------------------+------------------------+------------------------------------------------+
| :ref:`modindex` | :ref:`l-example` | :ref:`search` | :ref:`l-license` | :ref:`l-changes` | :ref:`l-README` |
+----------------------+---------------------+---------------------+--------------------+------------------------+------------------------------------------------+
| :ref:`genindex` | :ref:`l-FAQ` | :ref:`l-notebooks` | | :ref:`l-statcode` | `Unit Test Coverage <coverage/index.html>`_ |
+----------------------+---------------------+---------------------+--------------------+------------------------+------------------------------------------------+


Navigation
==========
----------

.. toctree::
:maxdepth: 1

doctestunit
generatedoc
generatesetup
installation
all_example
all_FAQ
all_notebooks
glossary
index_module
license
filechanges
README
all_indexes



indexmenu
20 changes: 20 additions & 0 deletions _doc/sphinxdoc/source/indexmenu.rst
@@ -0,0 +1,20 @@

table of contents
=================

.. toctree::
:maxdepth: 2

doctestunit
generatedoc
generatesetup
installation
all_example
all_FAQ
all_notebooks
glossary
index_module
license
filechanges
README
all_indexes
6 changes: 3 additions & 3 deletions _unittests/run_unittests.py
Expand Up @@ -11,16 +11,16 @@ def main():
except ImportError:
sys.path.append ( os.path.normpath (os.path.abspath(os.path.join( os.path.split(__file__)[0],"..","..","pyquickhelper","src"))))
import pyquickhelper

try:
import pyensae
except ImportError:
sys.path.append ( os.path.normpath (os.path.abspath(os.path.join( os.path.split(__file__)[0],"..","..","pyensae","src"))))
import pyensae

from pyquickhelper import fLOG, run_cmd, main_wrapper_tests
fLOG(OutputPrint = True)
main_wrapper_tests(__file__)

if __name__ == "__main__" :
main()
main()
47 changes: 23 additions & 24 deletions _unittests/ut_custom_server/test_custom_server.py
Expand Up @@ -27,81 +27,80 @@
from src.pyrsslocal.helper.download_helper import get_url_content

class TestCustomServer(unittest.TestCase):

def test_custom_server(self) :
fLOG (__file__, self._testMethodName, OutputPrint = __name__ == "__main__")

fold = os.path.abspath(os.path.split(__file__)[0])
dbfile = os.path.join( fold, "out_custom_server.db3")
if os.path.exists(dbfile) : os.remove(dbfile)

db = Database(dbfile, LOG = fLOG)
df = pandas.DataFrame ( [ {"name":"xavier", "module":"pyrsslocal"} ] )
db.connect()
db.import_dataframe(df, "example")
db.close()

server = CustomDBServer(('localhost', 8097), dbfile, CustomDBServerHandler)
thread = CustomDBServer.run_server(server, dbfile = dbfile, thread = True)

url = "http://localhost:8097/p_aserver.html"
cont = get_url_content(url)
assert len(cont)> 0
assert "xavier" in cont
thread.shutdown()

thread.shutdown()
assert not thread.is_alive()

assert os.path.exists(dbfile)

def test_custom_server_location(self) :
fLOG (__file__, self._testMethodName, OutputPrint = __name__ == "__main__")

fold = os.path.abspath(os.path.split(__file__)[0])
dbfile = os.path.join( fold, "out_custom_server2.db3")
if os.path.exists(dbfile) : os.remove(dbfile)

db = Database(dbfile, LOG = fLOG)
df = pandas.DataFrame ( [ {"name":"xavier", "module":"pyrsslocal"} ] )
db.connect()
db.import_dataframe(df, "example")
db.close()

server = CustomDBServer(('localhost', 8099), dbfile, CustomDBServerHandler,
root = os.path.join(fold, "data"))
thread = CustomDBServer.run_server(server, dbfile = dbfile, thread = True,
extra_path = os.path.join(fold, "data"))

url = "http://localhost:8099/index.html"
cont = get_url_content(url)
assert len(cont)> 0
assert "unittest" in cont
thread.shutdown()


thread.shutdown()
assert not thread.is_alive()
assert os.path.exists(dbfile)


if __name__ == "__main__" :

if False :
import webbrowser
port = 8098
fold = os.path.abspath(os.path.split(__file__)[0])
dbfile = os.path.join( fold, "out_custom_server.db3")

db = Database(dbfile)
df = pandas.DataFrame ( [ {"name":"xavier", "module":"pyrsslocal"} ] )
db.connect()
db.import_dataframe(df, "example")
db.close()

url = "http://localhost:%d/p_aserver.html" % port
fLOG("opening ", url)
webbrowser.open(url)
CustomDBServer.run_server(None, dbfile, port = port, extra_path = os.path.join(fold,"data"))


unittest.main ()


unittest.main ()
4 changes: 2 additions & 2 deletions _unittests/ut_helper/test_content.py
Expand Up @@ -25,12 +25,12 @@


class TestContent (unittest.TestCase):

def test_sample(self) :
fLOG (__file__, self._testMethodName, OutputPrint = __name__ == "__main__")
cont = get_subscriptions_example()
assert len(cont)>0


if __name__ == "__main__" :
unittest.main ()
unittest.main ()
6 changes: 3 additions & 3 deletions _unittests/ut_module/test_version.py
Expand Up @@ -16,17 +16,17 @@


class TestVersion (unittest.TestCase):

def test_version(self) :
setup = os.path.join(os.path.split(__file__)[0],"..", "..", "setup.py")
with open(setup,"r") as f : c = f.read()
reg = re.compile("sversion *= \\\"(.*)\\\"")

f = reg.findall(c)
if len(f) != 1 :
raise Exception("not only one version")
assert f[0] == __version__


if __name__ == "__main__" :
unittest.main ()
unittest.main ()

0 comments on commit 5397467

Please sign in to comment.