Commits

Juan BC  committed 931dcca

added version dinamically for sphinx

  • Participants
  • Parent commits cebe4be
  • Tags 0.1.1

Comments (0)

Files changed (3)

File doc/source/conf.py

             dst_fp.write(src)
     sys.exit(0)
 
+import yatel
 
 # If your documentation needs a minimal Sphinx version, state it here.
 #needs_sphinx = '1.0'
 # built documents.
 #
 # The short X.Y version.
-version = '0.1'
+version = ".".join(yatel.VERSION)
 # The full version, including alpha/beta/rc tags.
-release = '0.1'
+release = version
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File doc/source/install.rst

 Ubuntu/Debian/Mint
 ------------------
 
-#. Execute
+1. Execute
 
-    ::
-        sudo apt-get install python-setuptools python-pip python-qt4
-        python-qt4-gl python-qt4-phonon build-essential python-dev swig
-        subversion python-numpy python-qscintilla2 python-sip
+    .. code-block:: bash
 
+            $ sudo apt-get install python-setuptools python-pip python-qt4
+              python-qt4-gl python-qt4-phonon build-essential python-dev swig
+              subversion python-numpy python-qscintilla2 python-sip
 
-#. Next install box2d
+.. _box2d:
 
-.. code-block:: bash
+2. Next install box2d
 
-    $ svn checkout http://pybox2d.googlecode.com/svn/trunk/ pybox2d
-    $ cd pybox2d
-    $ python setup.py build
-    $ sudo python setup.py install
+    .. code-block:: bash
 
-#. Finally
+        $ svn checkout http://pybox2d.googlecode.com/svn/trunk/ pybox2d
+        $ cd pybox2d
+        $ python setup.py build
+        $ sudo python setup.py install
 
-    ::
-        $ sudo pip install yatel
+3. **Optional** GraphTool
+
+    This lib is used only on module ``yatel.conversors.graph_tool2yatel``
+    The instalation notes are here:
+
+        http://projects.skewed.de/graph-tool/wiki/GraphToolDownload#DebianandUbuntu
+
+4. Finally
+
+    .. code-block:: bash
+
+            $ sudo pip install yatel
 
 
 Windows or other *nix
     - QScintilla 2 http://www.riverbankcomputing.co.uk/software/qscintilla
     - Sip http://www.riverbankcomputing.co.uk/software/sip
     - NumPy http://numpy.scipy.org/
-    - **ONLY IN WINDOWS** http://pypi.python.org/pypi/pyreadline
-    - **ONLY IN WINDOWS** http://pybox2d.googlecode.com
+    - PyBox2d http://pybox2d.googlecode.com (in linux see box2d_)
+    - GraphTool http://projects.skewed.de/graph-tool/wiki/GraphToolDownload
+      (For use ``yatel.conversors.graph_tool2yatel``)
+    - **ONLY IN WINDOWS** PyReadLine http://pypi.python.org/pypi/pyreadline
 
 Finally open a console and execute
 
-::
-    easy_install yatel
+    .. code-block:: bat
 
+        > easy_install yatel
 
 
 
 
+
     "PyQt4" : "http://www.riverbankcomputing.co.uk/software/pyqt",
     "PyQt4.Qsci" : "http://www.riverbankcomputing.co.uk/software/qscintilla",
     "PyQt4.phonon" : "http://www.riverbankcomputing.co.uk/software/pyqt",
-    "graph_tool" : "http://projects.skewed.de/graph-tool/",
-    "box2d": "https://code.google.com/p/pybox2d/",
+    "Box2D": "https://code.google.com/p/pybox2d/",
     "numpy": "http://numpy.scipy.org/",
 }
 
 
+SUGESTED = {
+    "graph_tool" : "http://projects.skewed.de/graph-tool/",
+}
+
+
 #===============================================================================
-# WARNINGS FOR MANUAL REQUIRES
+# WARNINGS FOR MANUAL REQUIRES AND SUGGESTED
 #===============================================================================
 
-not_found = []
-for name, url in MANUAL_REQUIRE.items():
-    try:
-        __import__(name)
-    except ImportError:
-        not_found.append("{} requires '{}' ({})".format(yatel.PRJ,
-                                                        name, url))
+def validate_modules(requires)
+    not_found = []
+    for name, url in MANUAL_REQUIRE.items():
+        try:
+            __import__(name)
+        except ImportError:
+            not_found.append("{} requires '{}' ({})".format(yatel.PRJ,
+                                                             name, url))
+    return not_found
 
+def print_not_found(not_found, msg):
+    limits = "=" * max(map(len, not_found))
+    print "\n{}\n{}\n{}\n{}\n".format(msg, limits,
+                                        "\n".join(not_found),
+                                        limits)
+
+not_found = validate_modules(MANUAL_REQUIRE)
 if not_found:
-    limits = "=" * max(map(len, not_found))
-    print "\nWARNING\n{}\n{}\n{}\n".format(limits,
-                                            "\n".join(not_found),
-                                            limits)
+    print_not_found(not_found, "ERROR")
+    sys.exit(1)
+
+
+not_found = validate_modules(MANUAL_REQUIRE)
+if not_found:
+    print_not_found(not_found, "WARNING")
 
 
 #===============================================================================