Commits

George Notaras  committed 97d8101 Merge
  • Participants
  • Parent commits 5785077, 5b72859
  • Tags 1.0.2a1

Comments (0)

Files changed (68)

-864df6f8d825151fcfc862896e81d9c04ef269f9 0.2.1
-e51711d0707bf7419fa55bd3d398a5cf08411272 0.2.3
+5c08d1bd9ace73ff671b34b1a51788488b518d46 0.2.1
+b0e87679ae241ae032d30ee5067038db5da237c2 0.2.3
+bcce57413be3e4b2ca8c578294894234be97bd95 1.0.1a1
-George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
+sysscope Authors and Contributors
+------------------------------------------------------------------------
+sysscope has been developed by:
 
+ * George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
+
+The following people have contributed to this project in one way or another:
+
+ *

File BUGS

-sysscope Bugs
-------------------------------------------------------------------------
-
-You can view/search existing tickets or submit new ones at:
-
-	https://www.codetrax.org/projects/sysscope/report
-
-Bugs reported by means other than the ticket system are silently ignored.
-

File ChangeLog

-sysscope Changelog
-------------------------------------------------------------------------
-
-0.0.0 -> 0.1.0
-
-* Initial public alpha release
-
 sysscope Installation Instructions
-------------------------------------------------------------------------
+========================================================================
 
-To install sysscope run:
+This section contains information about how to download and install
+sysscope in your system. It also contains brief instructions about how
+to build the included documentation.
 
-  python setup.py install
 
-For installation to a custom location you can use something like the following:
+Requirements
+============
 
-  python setup.py install --prefix=/usr --root=/tmp
+This application requires Python_ 2.4 or later and a functional installation
+of Django_.
 
-For more information about the 'install' command, study the help message:
+.. _Python: http://python.org
+.. _Django: http://www.djangoproject.com
 
-  python setup.py --help install
+Detailed information about the minimum supported Django version and other
+Python modules that may be required in order to run this software is shown
+below:
 
+.. literalinclude:: ../requirements.txt
+
+This information exists in the ``requirements.txt`` file inside the
+sysscope distribution package. If ``pip`` is used to install this software,
+then all these dependencies will also be installed, if they are not already
+installed in your system.
+
+
+Download
+========
+
+You can download the latest sysscope releases from the `releases page`_ at
+the *Python Package Index* (PyPI).
+
+.. _`releases page`: http://pypi.python.org/pypi/sysscope
+
+Alternatively, you can clone the project's public source code repository
+and then check-out any stable release, all of which are tagged::
+
+    hg clone https://source.codetrax.org/hgroot/sysscope
+    hg tags
+    hg update 0.1.0
+
+
+Install
+=======
+
+To install sysscope, use the provided installation script::
+
+    python setup.py install
+
+You can install ``sysscope`` using ``pip``::
+
+    pip install sysscope
+
+Or use ``easy_install``::
+
+    easy_install -Z sysscope
+
+Note: the ``-Z`` flag is required to force ``easy_install`` to do a normal
+source install rather than a zipped egg; sysscope cannot be
+used from a zipped egg install.
+
+Alternatively, you can simply place the ``sysscope`` directory,
+which exists under the ``src`` directory, somewhere on your Python path
+or symlink to it from somewhere on your Python path.
+
+Finally, it is also possible to install this application directly from
+the `source code repository`_ using ``pip``::
+
+    pip install -e hg+https://source.codetrax.org/hgroot/sysscope#egg=sysscope
+
+The above command will install the latest development release of
+sysscope.
+
+To install a stable release directly from the `source code repository`_,
+for instance, the ``0.1.0`` release, run the following command::
+
+    pip install -e hg+https://source.codetrax.org/hgroot/sysscope@0.1.0#egg=sysscope-0.1.0
+
+Please note that the mercurial_ source control management tool is required
+for this operation.
+
+.. _mercurial: http://mercurial.selenic.com/
+.. _`source code repository`: https://source.codetrax.org/hgroot/sysscope
+
+
+How to build the documentation
+==============================
+
+This project's documentation is located in source form under the ``docs``
+directory. In order to convert the documentation to a format that is
+easy to read and navigate you need the ``sphinx`` package.
+
+You can install ``sphinx`` using ``pip``::
+
+    pip install sphinx
+
+Or ``easy_install``::
+
+    easy_install sphinx
+
+Once ``sphinx`` is installed, change to the ``docs`` directory, open a shell
+and run the following command::
+
+    make html
+
+This will build a HTML version of the documentation. You can read the
+documentation by opening the following file in any web browser::
+
+    docs/_build/html/index.html
+
 include AUTHORS
-include BUGS
-include ChangeLog
 include INSTALL
 include LICENSE
-include MANIFEST.in
 include NOTICE
 include README
+include MANIFEST.in
+include requirements.txt
 include setup.cfg
 include setup.py
-include docs/
-include etc/sysscope.conf.default
-include etc/sysscope.httpd.conf.default
-include etc/sysscope.d/example.conf.default
-include media/css/style.css
-include media/cgi-bin/sysscope.cgi
-include media/cgi-bin/wsgi.py
-include media/images/
-include media/js/
-include scripts/sysscope
-recursive-include sysscope *.py
+recursive-include src/sysscope *.py *.json *.mo *.po *.html
+graft docs
 This product includes software developed at:
-	- CodeTRAX (http://www.codetrax.org/)
-	- G-Loaded (http://www.g-loaded.eu/)
 
-Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
+* CodeTRAX (http://www.codetrax.org/)
+* G-Loaded Journal (http://www.g-loaded.eu/)
 
-Trade names include, but are not limited to:
+Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
 
-    * "sysscope"
-    * "TRAX"
-    * "codeTRAX"
-    * "G-Loaded"
+Brand names include, but are not limited to:
+
+* sysscope
+* sysscope
+* CodeTRAX
+* G-Loaded Journal
 
 The aforementioned names must not appear in the names of products derived from
 this software without prior written permission of George Notaras.
 
 For license information, please read the LICENSE file.
 
+Django is a registered trademark of the Django Software Foundation.
 sysscope
-------------------------------------------------------------------------
+========================================================================
 
-sysscope is a ...
-
-... blah blah ...
-
-Project Development Site and Downloads:
-	https://www.codetrax.org/projects/sysscope
-
-Project Summary :
-	N/A
-
-Project News:
-	N/A
-
-Community Support:
-	N/A
-
-
-Requirements
-============
-
-In order to run sysscope you will need:
-
-- blah version (TODO)
-
-
-Installation
-============
-
-For installation instructions please read the INSTALL file.
-
-
-Configuration
-=============
-
-TODO
-
-
-Bugs
-====
-
-You can view existing tickets or submit new ones (requires registration) at:
-
-	https://www.codetrax.org/projects/sysscope/report/1
-
-Bugs reported by other means than the ticket system are silently ignored.
-
-
-Support
-=======
-
-CodeTRAX does not provide support for sysscope.
-You can still get community support at the Community Support Forums:
-
-	N/A
-
-
-Copyright
-=========
-
-Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-
+This software is experimental. Not ready for testing
 
 License
 =======
 
-Licensed under the Apache License, Version 2.0 (the "License");
+Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
+
+Licensed under the *Apache License, Version 2.0* (the "*License*");
 you may not use this file except in compliance with the License.
 
 Unless required by applicable law or agreed to in writing, software
 See the License for the specific language governing permissions and
 limitations under the License.
 
-A copy of the License exists in the product distribution; the LICENSE file.
-For copyright notes please read the NOTICE file.
-
-
+A copy of the License exists in the product distribution; the *LICENSE* file.
+For copyright and other important notes regarding this release please read
+the *NOTICE* file.

File docs/Makefile

+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sysscope.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sysscope.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/sysscope"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sysscope"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	make -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."

File docs/conf.py

+# -*- coding: utf-8 -*-
+#
+# sysscope documentation build configuration file, created by
+# sphinx-quickstart on Sun Nov 14 09:50:21 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+sys.path.insert(0, os.path.abspath(os.path.join('..', 'src')))
+from sysscope import get_version
+
+# This required in order to make autodoc extension work.
+from django.conf import settings
+settings.configure()
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#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.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
+
+# Add any paths that contain templates here, relative to this directory.
+#templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'sysscope'
+copyright = u'2012, George Notaras'
+
+# 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 = get_version()
+# The full version, including alpha/beta/rc tags.
+release = get_version()
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#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
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#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 = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# 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 = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# 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,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# 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'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is 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 = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'sysscopedoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'sysscope.tex', u'sysscope Documentation',
+   u'George Notaras', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#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', 'sysscope', u'sysscope Documentation',
+     [u'George Notaras'], 1)
+]
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'sysscope'
+epub_author = u'George Notaras'
+epub_publisher = u'George Notaras'
+epub_copyright = u'2012, George Notaras'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# 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 = []
+
+# 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 = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True

File docs/configuration.rst

+
+=============
+Configuration
+=============
+
+This section contains information about how to configure your Django projects
+to use *sysscope* and also contains a quick reference of the available
+*settings* that can be used in order to customize the functionality of this
+application.
+
+
+Configuring your project
+========================
+
+In the Django project's ``settings`` module, add ``sysscope`` to the
+``INSTALLED_APPS`` setting::
+
+    INSTALLED_APPS = (
+        ...
+        'sysscope',
+    )
+
+
+URLS
+====
+
+Add the ``sysscope`` specific URL patterns to the ``urls.py`` file of
+your project::
+
+    # URLs for sysscope
+    urlpatterns += patterns('',
+        url('^sysscope/', include('sysscope.urls')),
+    )
+
+
+Reference of the application settings
+=====================================
+
+The following settings can be specified in the Django project's ``settings``
+module to customize the functionality of *sysscope*.
+
+``SETTING_A``
+    Setting A ...
+
+
+Synchronize the project database
+================================
+
+Finally, synchronize the project's database using the following command::
+
+    python manage.py syncdb
+

File docs/faq.rst

Binary file added.

File docs/index.rst

+.. sysscope documentation master file, created by
+   sphinx-quickstart on Sun Nov 14 09:50:21 2010.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+=========================
+sysscope's documentation
+=========================
+
+Copyright 2012 `George Notaras`_ <gnot [at] g-loaded.eu>
+
+.. _`George Notaras`: http://www.g-loaded.eu/
+
+Welcome to the *sysscope*'s documentation!
+
+
+About this project
+==================
+
+sysscope - Tool for visual representation of RRDtool's Round Robin Databases.
+
+| **Author**: `George Notaras <http://www.g-loaded.eu/>`_
+| **Development Web Site**: `sysscope project <http://www.codetrax.org/projects/sysscope>`_
+| **Source Code Repository**: `sysscope source code <https://source.codetrax.org/hgroot/sysscope>`_
+| **Documentation**: `sysscope documentation <http://packages.python.org/sysscope>`_
+| **Downloads**: `sysscope releases <http://pypi.python.org/pypi/sysscope>`_
+
+
+About this guide
+================
+
+This guide provides an introduction to the *sysscope* |version| release,
+including instructions about how to install, configure and use it in
+Django projects or individual Django applications.
+
+The contents of this documentation (the "*Documentation*") are subject to the
+*Apache License, Version 2.0* (the "*License*"); you may only use this
+Documentation if you comply with the terms of this License.
+
+A copy of the License exists in the product distribution; the *LICENSE* file.
+For copyright and other important notes regarding this release please read
+the *NOTICE* file.
+
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+   
+   introduction
+   installation
+   configuration
+   usage
+   faq
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+
+.. seealso::
+
+    * All projects_ published by CodeTRAX.
+    * The official `Django Documentation`_.
+
+.. _projects: http://www.codetrax.org/projects
+.. _`Django Documentation`: http://docs.djangoproject.com/en/
+

File docs/installation.rst

+
+============
+Installation
+============
+
+This section contains information about how to download and install
+sysscope in your system. It also contains brief instructions about how
+to build the included documentation.
+
+
+Requirements
+============
+
+This application requires Python_ 2.4 or later and a functional installation
+of Django_.
+
+.. _Python: http://python.org
+.. _Django: http://www.djangoproject.com
+
+Detailed information about the minimum supported Django version and other
+Python modules that may be required in order to run this software is shown
+below:
+
+.. literalinclude:: ../requirements.txt
+
+This information exists in the ``requirements.txt`` file inside the
+sysscope distribution package. If ``pip`` is used to install this software,
+then all these dependencies will also be installed, if they are not already
+installed in your system.
+
+
+Download
+========
+
+You can download the latest sysscope releases from the `releases page`_ at
+the *Python Package Index* (PyPI).
+
+.. _`releases page`: http://pypi.python.org/pypi/sysscope
+
+Alternatively, you can clone the project's public source code repository
+and then check-out any stable release, all of which are tagged::
+
+    hg clone https://source.codetrax.org/hgroot/sysscope
+    hg tags
+    hg update 0.1.0
+
+
+Install
+=======
+
+To install sysscope, use the provided installation script::
+
+    python setup.py install
+
+You can install ``sysscope`` using ``pip``::
+
+    pip install sysscope
+
+Or use ``easy_install``::
+
+    easy_install -Z sysscope
+
+Note: the ``-Z`` flag is required to force ``easy_install`` to do a normal
+source install rather than a zipped egg; sysscope cannot be
+used from a zipped egg install.
+
+Alternatively, you can simply place the ``sysscope`` directory,
+which exists under the ``src`` directory, somewhere on your Python path
+or symlink to it from somewhere on your Python path.
+
+Finally, it is also possible to install this application directly from
+the `source code repository`_ using ``pip``::
+
+    pip install -e hg+https://source.codetrax.org/hgroot/sysscope#egg=sysscope
+
+The above command will install the latest development release of
+sysscope.
+
+To install a stable release directly from the `source code repository`_,
+for instance, the ``0.1.0`` release, run the following command::
+
+    pip install -e hg+https://source.codetrax.org/hgroot/sysscope@0.1.0#egg=sysscope-0.1.0
+
+Please note that the mercurial_ source control management tool is required
+for this operation.
+
+.. _mercurial: http://mercurial.selenic.com/
+.. _`source code repository`: https://source.codetrax.org/hgroot/sysscope
+
+
+How to build the documentation
+==============================
+
+This project's documentation is located in source form under the ``docs``
+directory. In order to convert the documentation to a format that is
+easy to read and navigate you need the ``sphinx`` package.
+
+You can install ``sphinx`` using ``pip``::
+
+    pip install sphinx
+
+Or ``easy_install``::
+
+    easy_install sphinx
+
+Once ``sphinx`` is installed, change to the ``docs`` directory, open a shell
+and run the following command::
+
+    make html
+
+This will build a HTML version of the documentation. You can read the
+documentation by opening the following file in any web browser::
+
+    docs/_build/html/index.html
+

File docs/introduction.rst

+
+============
+Introduction
+============
+
+This section contains an introduction to *sysscope*, including general
+information about how to submit bug reports and make feature requests.
+
+sysscope - Tool for visual representation of RRDtool's Round Robin Databases.
+
+Licensed under the *Apache License version 2.0*. More licensing information
+exists in the license_ section.
+
+
+Features
+========
+
+- Feature A
+- Feature B
+
+
+Documentation
+=============
+
+Apart from the `sysscope Online Documentation`_, more information about the
+installation, configuration and usage of this application may be available
+at the project's wiki_.
+
+.. _`sysscope Online Documentation`: http://packages.python.org/sysscope
+.. _wiki: http://www.codetrax.org/projects/sysscope/wiki
+
+
+Donations
+=========
+
+This software is released as free-software and provided to you at no cost. However,
+a significant amount of time and effort has gone into developing this software
+and writing this documentation. So, the production of this software has not
+been free from cost. It is highly recommended that, if you use this software
+*in production*, you should consider making a donation.
+
+To make a donation, please visit the CodeTRAX `donations page`_ which contains
+a PayPal_ *donate* button.
+
+Thank you for considering making a donation to sysscope.
+
+.. _`donations page`: https://source.codetrax.org/donate.html
+.. _PayPal: https://www.paypal.com
+
+
+Bugs and feature requests
+=========================
+
+In case you run into any problems while using this application or think that
+a new feature should be implemented, it is highly recommended you submit_ a new
+report about it at the project's `issue tracker`_.
+
+Using the *issue tracker* is the recommended way to notify the authors about
+bugs or make feature requests. Also, before submitting a new report, please
+make sure you have read the `new issue guidelines`_.
+
+.. _submit: http://www.codetrax.org/projects/sysscope/issues/new
+.. _`issue tracker`: http://www.codetrax.org/projects/sysscope/issues
+.. _`new issue guidelines`: http://www.codetrax.org/NewIssueGuidelines
+
+
+Support
+=======
+
+CodeTRAX does not provide support for sysscope.
+
+You can still get community support at the `Community Support Forums`_:
+
+.. _`Community Support Forums`: http://www.codetrax.org/projects/sysscope/boards
+
+
+License
+=======
+
+Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
+
+Licensed under the *Apache License, Version 2.0* (the "*License*");
+you may not use this file except in compliance with the License.
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+A copy of the License exists in the product distribution; the *LICENSE* file.
+For copyright and other important notes regarding this release please read
+the *NOTICE* file.

File docs/make.bat

+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html       to make standalone HTML files
+	echo.  dirhtml    to make HTML files named index.html in directories
+	echo.  singlehtml to make a single large HTML file
+	echo.  pickle     to make pickle files
+	echo.  json       to make JSON files
+	echo.  htmlhelp   to make HTML files and a HTML help project
+	echo.  qthelp     to make HTML files and a qthelp project
+	echo.  devhelp    to make HTML files and a Devhelp project
+	echo.  epub       to make an epub
+	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  text       to make text files
+	echo.  man        to make manual pages
+	echo.  changes    to make an overview over all changed/added/deprecated items
+	echo.  linkcheck  to check all external links for integrity
+	echo.  doctest    to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "singlehtml" (
+	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\sysscope.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\sysscope.ghc
+	goto end
+)
+
+if "%1" == "devhelp" (
+	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished.
+	goto end
+)
+
+if "%1" == "epub" (
+	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The epub file is in %BUILDDIR%/epub.
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "text" (
+	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The text files are in %BUILDDIR%/text.
+	goto end
+)
+
+if "%1" == "man" (
+	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The manual pages are in %BUILDDIR%/man.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end

File docs/usage.rst

+
+=====
+Usage
+=====
+
+This section contains information, including examples, about how to use
+*sysscope* in your existing Django projects or applications.
+

File media/cgi-bin/sysscope.cgi

-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-#  This file is part of sysscope.
-#
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
-#
-#  Project: https://www.codetrax.org/projects/sysscope
-#
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-
-import sys
-import os
-from sysscope.web.base import dispatcher
-
-def write(msg):
-	sys.stdout.write('%s\n' % msg)
-	sys.stdout.flush()
-
-def start_response(status, headers):
-	for header in headers:
-		write( '%s: %s\r' % (header[0], header[1]))
-	write('')
-	# return write
-
-for response in base.dispatcher(os.environ, start_response):
-	write( i)

File media/cgi-bin/wsgi.py

-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-#  This file is part of sysscope.
-#
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
-#
-#  Project: https://www.codetrax.org/projects/sysscope
-#
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-
-import sys
-import os
-
-# Append directories to the PYTHON PATH
-# The src directory
-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'src')) )
-
-#from flup.server.fcgi import WSGIServer
-
-from sysscope.web.base import dispatcher
-
-#WSGIServer(dispatcher).run()
-
-application = dispatcher
-

File media/css/style.css

-
-
-body {
-    font-family: sans-serif;
-    font-size: 100%;
-    margin: 0;
-    padding: 0;
-}
-
-#container {
-	width: 90%;
-	margin: 10px auto;
-	background-color: #fff;
-	color: #000;
-	border: 1px solid gray;
-	line-height: 130%;
-}
-
-#header {
-	padding: 1em;
-	background-color: #103152;
-}
-
-#header h1 {
-	padding: 0;
-	margin: 0;
-	color: #fff;
-}
-
-#sections {
-	float: left;
-	width: 240px;
-	margin: 0;
-	border: 1px dashed #ccc;
-}
-
-#sections p {
-	margin: 0 0 1em 0;
-}
-
-#browser {
-	padding: 1em;
-	text-align: center;
-}
-
-#graphs {
-	margin-left: 250px;
-	border-left: 1px solid gray;
-	padding: 2em 1em;
-	text-align: center;
-}
-
-#graphs h2 {
-	padding: 0;
-	margin: 0 0 .5em 0;
-}
-
-#footer {
-	clear: both;
-	margin: 0;
-	padding: .5em;
-	border-top: 1px solid gray;
-	font-size: 70%;
-	color: #333;
-	text-align: center;
-}
-
-#footer a {
-	color: #333;
-	text-decoration: none;
-}
-
-#graph {
-	margin: 30px auto;
-}
-
-

File requirements.txt

+sysscope
+Django
+Sphinx

File scripts/sysscope

-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-#  This file is part of sysscope.
-#
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
-#
-#  Project: https://www.codetrax.org/projects/sysscope
-#
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-
-#import sys
-#from sysscope import syntax
-#
-#syntax.test('etc/sysscope.conf')
-#sys.exit(0)
-
-import sys
-import sysscope.main
-
-SINGLE_SECTION = ''
-if len(sys.argv) >= 2:
-	SINGLE_SECTION = sys.argv[1]
-
-sysscope.main.Main(SINGLE_SECTION)
-
 optimize = 1
 
 [bdist_rpm]
-doc_files = AUTHORS BUGS ChangeLog LICENSE NOTICE README
-group = Applications/System
+doc_files = AUTHORS LICENSE NOTICE README docs
+group = Development/Libraries
 
+[build_sphinx]
+source-dir = docs/
+all_files  = 1
 #
 #  This file is part of sysscope.
 #
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
+#  sysscope - Tool for visual representation of RRDtool's Round Robin Databases.
 #
-#  Project: https://www.codetrax.org/projects/sysscope
+#  Development Web Site:
+#    - http://www.codetrax.org/projects/sysscope
+#  Public Source Code Repository:
+#    - https://source.codetrax.org/hgroot/sysscope
 #
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
+#  Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #    python setup.py install --prefix=/usr
 #
 
-
 import sys
 import os
-sys.path.append(os.path.abspath('src'))
+sys.path.insert(0, os.path.abspath('src'))
 
-from distutils.core import setup
-from sysscope import info
+from setuptools import setup
+
+from sysscope import get_version
+
+def read(fname):
+    """Utility function to read the README file."""
+    return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
 if __name__=='__main__':
-	setup(
-		name = info.name,
-		version = info.version,
-		description = info.description,
-		long_description = info.long_description,
-		author = info.author,
-		author_email = info.author_email,
-		url = info.url,
-		download_url = info.download_url,
-		license = info.license,
-		classifiers = info.classifiers,
+    setup(
+        name = 'sysscope',
+        version = get_version(),
+        license = 'Apache License version 2',
+        author = 'George Notaras',
+        author_email = 'gnot [at] g-loaded.eu',
+        maintainer = 'George Notaras',
+        maintainer_email = 'gnot [at] g-loaded.eu',
+        url = 'http://www.codetrax.org/projects/sysscope',
+        description = """sysscope - Tool for visual representation of RRDtool's Round Robin Databases.""",
+        long_description = read('README'),
+        download_url = 'https://source.codetrax.org/hgroot/sysscope',
+        platforms=['any'],
+        classifiers = [
+            'Development Status :: 4 - Beta',
+            'Environment :: Web Environment',
+            'Framework :: Django',
+            'Intended Audience :: Developers',
+            'License :: OSI Approved :: Apache Software License',
+            'Natural Language :: English',
+            'Operating System :: OS Independent',
+            'Programming Language :: Python',
+            'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+            'Topic :: Software Development :: Libraries :: Application Frameworks',
+            'Topic :: Software Development :: Libraries :: Python Modules',
+        ],
         package_dir = {'': 'src'},
-		packages = [
-				'sysscope',
-				'sysscope.web',
-				#'sysscope.web.handlers',
-				],
-		scripts = ['scripts/sysscope'],
-		data_files = [
-			('/etc', [
-				'etc/sysscope.conf.default',
-				'etc/sysscope.httpd.conf.default',
-				]),
-			('/etc/sysscope.d', ['etc/sysscope.d/example.conf.default']),
-			('share/sysscope/css',		['media/css/style.css']),
-			('share/sysscope/cgi-bin',	[
-				'media/cgi-bin/sysscope.cgi',
-				'media/cgi-bin/wsgi.py',
-			]),
-			('share/sysscope/documentation',[]),
-			('share/sysscope/images',	[]),
-			('share/sysscope/js',		[]),
-			('/var/lib/sysscope/',		[]),
-			]
-		)
+        packages = [
+            'sysscope',
+            #'sysscope.templatetags',
+            #'sysscope.management',
+            #'sysscope.management.commands',
+        ],
+        include_package_data = True,
+        #install_requires=read('requirements.txt').splitlines(),
+        zip_safe = False,
+    )
 
-

File src/sysscope/__init__.py

 #
 #  This file is part of sysscope.
 #
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
+#  sysscope - Tool for visual representation of RRDtool's Round Robin Databases.
 #
-#  Project: https://www.codetrax.org/projects/sysscope
+#  Development Web Site:
+#    - http://www.codetrax.org/projects/sysscope
+#  Public Source Code Repository:
+#    - https://source.codetrax.org/hgroot/sysscope
 #
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
+#  Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
+
+# Scheme: <major>.<minor>.<maintenance>.<maturity>.<revision>
+# maturity: final/beta/alpha
+
+VERSION = (1, 0, 2, 'alpha', 1)
+
+def get_version():
+    version = '%s.%s' % (VERSION[0], VERSION[1])
+    if VERSION[2] is not None:
+        version = '%s.%s' % (version, VERSION[2])
+    if VERSION[3] != 'final':
+        if VERSION[4] > 0:
+            version = '%s%s%s' % (version, VERSION[3][0], VERSION[4])
+        else:
+            version = '%s%s' % (version, VERSION[3][0])
+    return version
+
+__version__ = get_version()
+
+def get_status_classifier():
+    if VERSION[3] == 'final':
+        return 'Development Status :: 5 - Production/Stable'
+    elif VERSION[3] == 'beta':
+        return 'Development Status :: 4 - Beta'
+    elif VERSION[3] == 'alpha':
+        return 'Development Status :: 3 - Alpha'
+    raise NotImplementedError
+

File src/sysscope/admin.py

+# -*- coding: utf-8 -*-
+#
+#  This file is part of sysscope.
+#
+#  sysscope - Tool for visual representation of RRDtool's Round Robin Databases.
+#
+#  Development Web Site:
+#    - http://www.codetrax.org/projects/sysscope
+#  Public Source Code Repository:
+#    - https://source.codetrax.org/hgroot/sysscope
+#
+#  Copyright 2012 George Notaras <gnot [at] g-loaded.eu>
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+
+from django.contrib import admin
+from django.db.models.loading import cache
+

File src/sysscope/commons.py

-# -*- coding: utf-8 -*-
-#
-#  This file is part of sysscope.
-#
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
-#
-#  Project: https://www.codetrax.org/projects/sysscope
-#
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-import string
-import subprocess
-
-from sysscope.exceptions import RrdToolError
-
-
-def get_variable_name_pool():
-    pool = []
-    for m in string.lowercase:
-        for n in string.lowercase:
-            pool.append("%s%s" % (m, n))
-    return pool
-
-
-def canonical_name(name):
-    """
-    - Removes disallowed characters (punctuation)
-    - Replaces spaces with dashes
-    - Strip dashes from start and end of string
-    - Converts to lowercase
-    """
-    def allowed_char(c):
-        if c not in string.punctuation:
-            return True
-    name = filter(allowed_char, name)
-    name = name.replace(' ', '-')
-    name = name.strip('-')
-    return name.lower()
-
-
-def get_graph_image_data(options):
-    args = ['rrdtool', 'graph', '-']
-    args.extend(options)
-    #import pprint
-    #pprint.pprint (args)
-    p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    image_data = p.stdout.read()
-    if not image_data:
-        import pprint
-        rrdtool_params = pprint.pformat(args)
-        raise RrdToolError(rrdtool_params)
-    errors = p.stdout.read()
-    if errors:
-        raise RrdToolError(errors)
-    #for line in p.stderr:
-    #    #print line
-    #    continue    # TODO: find way to display errors: mod_wsgi by default restricts printing to stdout
-    return image_data

File src/sysscope/config.py

-# -*- coding: utf-8 -*-
-#
-#  This file is part of sysscope.
-#
-#  sysscope - a graphing solution that facilitates the visual representation
-#             of RRDtool's Round Robin Databases (RRD).
-#
-#  Project: https://www.codetrax.org/projects/sysscope
-#
-#  Copyright 2008 George Notaras <gnot [at] g-loaded.eu>, CodeTRAX.org
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-import sys
-import os
-
-from sysscope.commons import canonical_name
-from sysscope import graphbase
-from sysscope.syntax import Syntax, DEFAULT_LEGEND_COLUMNS
-from sysscope.exceptions import sysscopeError
-
-
-class ConfigSyntaxError(sysscopeError):
-	def __init__(self, line_no, error_message):
-		self.line_no = line_no
-		self.value = error_message
-	def __str__(self):
-		return 'Syntax error in line %d. %s' % (self.line_no, self.value)
-
-class ConfigFileError(sysscopeError):
-	pass
-
-
-class Section:
-	def __init__(self, name):
-		self.name = name
-		self.canonical_name = canonical_name(name)
-	def __str__(self):
-		return self.name
-
-
-POSSIBLE_CONFIG_LOCATIONS = [
-	'/usr/local/etc/sysscope.conf',
-	'/etc/sysscope.conf',
-	'etc/sysscope.conf'
-	]
-
-	
-def get_configuration(global_only):
-	"""Helper function to get the configuration.
-	
-	Returns a sysscope.config.ConfigFileParser object
-	"""
-	CONFIG_PATH = ''
-	for loc in POSSIBLE_CONFIG_LOCATIONS:
-		if os.path.exists(loc):
-			CONFIG_PATH = loc
-	CFG = ConfigFileParser(CONFIG_PATH)
-	CFG.parse(global_only=global_only)
-	return CFG
-
-
-class ConfigFileParser:
-
-	COMMENT_CHAR = '#'
-
-	def __init__(self, path):
-
-		# Configuration file path
-		if not path:
-			raise ConfigFileError('Configuration file not found')
-		self.path = path
-
-		# How the configuration file is parsed:
-		#
-		# Each line is read from the config file and is put to the
-		# 'ConfigLineStack' stack. The lines are put in raw mode into
-		# the stack, meaning that no processing occurs during this
-		# operation, apart from striping the line and not including
-		# comments or empty lines.
-		#
-		# A function should pop() the configuration lines from the stack
-		# in order to be processed.
-		#
-		# This method is required in case the config file is divided
-		# into several smaller config files, which are imported into
-		# the main config file with the 'Include' directive.
-		self.ConfigLineStack = []
-
-		# Holds the global options, eg logfile, output dir etc
-		# Format: {
-		#	'option1' : value,
-		#	}
-		self.global_options = {}
-
-		# Holds the tree of sections and graphs
-		# Format: {
-		#	'section1' : [graph1, graph2, ...],
-		#	'section2' : [graph4],
-		#	}
-		# Types:
-		#   section : str
-		#   graph : graphbase.Graph instance
-		#
-		self.graphs = {}
-
-		# Holds the user-defined templates
-		# Format: {
-		#	'template1' : ['--opt1', 'opt1_value', '--opt2', --opt3', 'opt3_value', ...],
-		#	}
-		self.templates = {}
-
-		# This is set to the name of the first template that is read from the config.
-		# This is by convention considered the default template.
-		self.default_template = None
-
-		# Holds Section instances in the order sections are read from the config file.
-		self.sections_ordered = []
-
-		# 'reading_graph_options' signals the gathering of all the
-		# next directives, until a '</Graph>' tag is met. These
-		# directives are added to the following list as directive objects.
-		self.graph_directives = []	# Should be reset after graph directives have been processed
-
-		# Every time the parser enters a configuration block, it needs
-		# to store some information that is relative to the current
-		# configuration block or its parent blocks. This information is
-		# stored into the following variables.
-		self.current_section = ''	# Should be reset at </Section>
-		self.current_section_rrdbase = ''	# Should be reset at </Section>
-		self.current_template = ''	# Should be reset at </Template>
-		self.current_graph = None	# Should be reset after graph directives have been processed
-
-		# Switches
-		# These boolean variables show what the parser is doin, eg
-		# reading the template block.
-
-		# 'processing_template' becomes True whenever directives within
-		# a <Template..>...</Template> block are processed.
-		self.processing_template = False	# Should be reset at </Template>
-
-		# 'reading_graph_options' becomes True whenever a 'Graph' tag is met.
-		self.reading_graph_options = False	# Should be reset at </Graph>
-
-		# Read main config file
-		self.read_config_file(path)
-
-
-	def read_config_file(self, path):
-		f = open(path)
-		conflines = []
-		for line in f:
-			line = line.strip()
-			# Empty lines and comments are excluded:
-			if line and not line.startswith(self.COMMENT_CHAR):
-				conflines.append(line)
-		f.close()
-		self.ConfigLineStack.extend( reversed(conflines) )
-
-
-	def parse(self, global_only=False):
-		"""Parses the config file.
-
-		if 'global_only' is True, then only the directives in the GLOBAL
-		namespace are parsed. Nothing else.
-		"""
-
-		# Counter that is used for line numbering.
-		no = 0
-
-		# Master syntax class
-		# the parse_line() method returns an object of type 'tag' or 'directive'
-		ConfSyntax = Syntax()
-
-		# Iterate over the stack items.
-		while self.ConfigLineStack:
-
-			# retrieve one configuration line from the stack
-			line = self.ConfigLineStack.pop()
-
-			# Increment counter by one
-			#
-			# Special Note:
-			# The lines inside a <Graph ..>...</Graph> block are first saved in the
-			# 'self.graph_directives' list along with each line number (phase A)
-			# and then they are processed (phase B).
-			# In phase B (graph-directive processing mode) the counter should not be increased.
-			if self.graph_directives and not self.reading_graph_options:
-				pass
-			else:
-				no += 1
-
-			# Get entity
-			obj = ConfSyntax.parse_line(no, line)
-
-			# Check for GLOBAL ONLY PARSING
-			# If global_only parsing has been requested and the read
-			# object is a tag or it is an 'Include' directive,
-			# do nothing.
-			if global_only:
-				if obj.type == 'tag':
-					continue
-				elif obj.name == 'Include':
-					continue
-
-			# Include directive
-			# This directive imports an additional configuration file into self.ConfigLineStack
-			if obj.name == 'Include':
-
-				path = obj.value
-				self.read_config_file(path)
-				continue
-
-			if obj.type == 'tag':
-
-				if obj.is_closing_tag:	# The line contains a CLOSING TAG
-
-					# Reset the following variables
-					if obj.name == 'Section':
-						self.current_section = ''
-						self.current_section_rrdbase = ''
-					elif obj.name == 'Template':
-						self.current_template = ''
-						self.processing_template = False
-					elif obj.name == 'Graph':
-						self.reading_graph_options = False
-
-				else:			# The line contains an OPENING TAG
-
-					# Process Tags
-
-					if obj.name == 'Section':
-						section_name = obj.value
-
-						# Set the section that is being processed
-						self.current_section = section_name
-						# Add the section to the list, which contains the order of the sections
-						self.sections_ordered.append( Section(section_name) )
-						# Add the new section in the graphs dictionary
-						self.graphs[section_name] = []
-
-					elif obj.name == 'Template':
-						template_name = obj.value
-
-						# Set the current_template
-						self.current_template = template_name
-						# Add the template to self.templates
-						self.templates[template_name] = []
-						# Set the default template if it hasn't been set.
-						# This way the default template is always the first one that is read from the config
-						if not self.default_template:
-							self.default_template = template_name
-						# Set template-processing mode
-						self.processing_template = True
-
-					elif obj.name == 'Graph':
-						graph_name = obj.value
-
-						# Create instance of graph...
-						GraphRRD = graphbase.Graph(graph_name)
-						# ... add it to the current section's list graphs
-						self.graphs[self.current_section].append( GraphRRD )
-						# ... set the currently processed graph to 'GraphRRD'
-						self.current_graph = GraphRRD
-						# ... set graph-directive-gathering mode
-						self.reading_graph_options = True
-
-			elif self.processing_template:	# Template block processing mode
-
-				# Process directives within the <Template ...> ... </Template> block.
-				directive, directive_data = obj.name, obj.value
-
-				if directive in ('Option', 'RawOption'):
-
-					parts = directive_data.split(' ', 1)
-					# Add the option
-					if directive == 'Option':
-						option = '--%s' % parts[0]
-					else:
-						option = parts[0]
-					self.templates[self.current_template].append(option)
-					# Add the value, if applicable
-					if len(parts) > 1:
-						option_value = parts[1]
-						self.templates[self.current_template].append(option_value)
-
-			elif self.reading_graph_options:	# Graph-directive gathering mode
-
-				# This should *READ* lines that are within the <Graph ...> ... </Graph> block.
-				# The directive object is added to the 'self.graph_directives' list
-				self.graph_directives.append( obj )
-
-			elif obj.type == 'directive':	# If it is any other directive __outside__ <Graph>...</Graph> or <Template>...</Template>
-
-				directive, directive_data = obj.name, obj.value
-				#print 'Processing', directive, directive_data
-				self.global_options[directive] = directive_data
-				if directive == 'RRDBase':
-					self.current_section_rrdbase = directive_data
-
-			if self.graph_directives and not self.reading_graph_options:		# Graph-directive processing mode
-
-				# This should *PROCESS* self.current_graph's SAVED directives
-				# (lines that have been read from a <Graph ...> ... </Graph> block)
-
-				# Default template
-				# As default template is considered the the first <Template..>...</Template> block
-				# If a template is not defined for a graph using the 'TemplateName' directive, then
-				# the default template is used.
-				if not sum(1 for dctv in self.graph_directives if dctv.name == 'TemplateName'):
-					# If TemplateName is not used in the current graph, use the default template
-					#print "Using DEFAULT Template %s" % self.default_template
-					self.current_graph.merge_options( self.templates[self.default_template] )
-
-				# Process Legend-related directives.
-
-				# DoLegend
-				# By default, each 'DrawGraph' variable is added to the legend
-				# and 'Last','Min','Avg','Max','95th' items are displayed.
-				# The following gets False when a 'Legend off' directive is met.
-				DoLegend = True
-				for dctv in self.graph_directives:
-					if dctv.name == 'Legend' and dctv.value == 'Off':
-						DoLegend = False
-
-				# legend_columns
-				# Determine legend columns
-				if DoLegend:
-					legend_columns = DEFAULT_LEGEND_COLUMNS
-					for dctv in self.graph_directives:
-						if dctv.name == 'LegendColumns':
-							# Get a list of legend columns, eg ['Last', 'Min', 'Avg', 'Max']
-							legend_columns = [col.strip() for col in dctv.value.split(',') if col.strip()]
-
-				# longest_legend_label_len
-				# Determine the length of the longest legend label.
-				if DoLegend:
-					longest_legend_label_len = 0
-					for dctv in self.graph_directives:
-						if dctv.name == 'DrawGraph':
-							legend_label = dctv.value[-1]
-							if len(legend_label) > longest_legend_label_len:
-								longest_legend_label_len = len(legend_label)
-
-				# Process other directives
-				for graph_directive in self.graph_directives:
-
-					# Store the saved line number and the saved directive value in new variables.
-					# 'saved_no' should be used in error messages in this mode. This represents
-					# the actual config line number. 'no' remains unchanged in this mode.