Permalink
Browse files

update doc and setup.py

  • Loading branch information...
1 parent 6ae9995 commit a349b81efe41b979384a20cbb4b908f159293141 @zrong committed Jun 14, 2015
Showing with 55 additions and 31 deletions.
  1. +3 −3 docs/base.rst
  2. +8 −8 docs/conf.py
  3. +6 −0 docs/conf.rst
  4. +3 −3 docs/ftp.rst
  5. +3 −3 docs/gettext.rst
  6. +3 −3 docs/git.rst
  7. +2 −1 docs/index.rst
  8. +3 −3 docs/lua.rst
  9. +3 −2 docs/modules.rst
  10. +1 −1 rookout/__init__.py
  11. +19 −3 rookout/conf.py
  12. +1 −1 setup.py
View
@@ -1,6 +1,6 @@
-zrong.base module
-=================
+rookout.base module
+====================
-.. automodule:: zrong.base
+.. automodule:: rookout.base
:members:
:show-inheritance:
View
@@ -49,17 +49,17 @@
master_doc = 'index'
# General information about the project.
-project = 'A python library'
+project = "rookout"
copyright = '2014~2015, zrong'
# 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 = '0.3.0'
+version = '0.4.0'
# The full version, including alpha/beta/rc tags.
-release = '0.3.0'
+release = '0.4.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -182,7 +182,7 @@
#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'Apythonlibrarydoc'
+htmlhelp_basename = 'rookout'
# -- Options for LaTeX output ---------------------------------------------
@@ -202,8 +202,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'Apythonlibrary.tex', 'A python library Documentation',
- 'zrong', 'manual'),
+ ('index', 'Apythonlibrary.tex', "A rookie's workout library by zrong.",
+ 'zrong', 'manual', 'rookout'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -232,7 +232,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'apythonlibrary', 'A python library Documentation',
+ ('index', 'apythonlibrary', "A rookie's workout library by zrong.",
['zrong'], 1)
]
@@ -246,7 +246,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'Apythonlibrary', 'A python library Documentation',
+ ('index', 'Apythonlibrary', "A rookie's workout library by zrong.",
'zrong', 'Apythonlibrary', 'One line description of project.',
'Miscellaneous'),
]
View
@@ -0,0 +1,6 @@
+rookout.conf module
+====================
+
+.. automodule:: rookout.conf
+ :members:
+ :show-inheritance:
View
@@ -1,7 +1,7 @@
-zrong.ftp module
-=================
+rookout.ftp module
+===================
-.. automodule:: zrong.ftp
+.. automodule:: rookout.ftp
:members:
:undoc-members:
:show-inheritance:
View
@@ -1,7 +1,7 @@
-zrong.gettext module
-=================
+rookout.gettext module
+===========================
-.. automodule:: zrong.gettext
+.. automodule:: rookout.gettext
:members:
:undoc-members:
:show-inheritance:
View
@@ -1,7 +1,7 @@
-zrong.git module
-=================
+rookout.git module
+====================
-.. automodule:: zrong.git
+.. automodule:: rookout.git
:members:
:undoc-members:
:show-inheritance:
View
@@ -14,9 +14,10 @@ Welcome to zrong's documentation!
lua
ftp
gettext
+ conf
Indices and tables
-==================
+===================
* :ref:`genindex`
* :ref:`modindex`
View
@@ -1,6 +1,6 @@
-zrong.lua module
-=================
+rookout.lua module
+===================
-.. automodule:: zrong.lua
+.. automodule:: rookout.lua
:members: decode, decode_file, encode
:show-inheritance:
View
@@ -1,5 +1,5 @@
-zrong
-=====
+rookout
+========
.. toctree::
@@ -8,3 +8,4 @@ zrong
lua
ftp
gettext
+ conf
View
@@ -15,7 +15,7 @@
import logging
__version__ = "0.4.0"
-__all__ = ['base', 'git', 'lua', 'ftp', 'gettext']
+__all__ = ['base', 'git', 'lua', 'ftp', 'gettext', 'conf']
slog = logging.getLogger("system")
"""默认的系统 log。"""
View
@@ -6,20 +6,30 @@
# Last Editing 2015-06-14
########################################
+"""
+.. module:: conf
+ :platform: Unix, Windows
+ :synopsis: 对配置文件的封装。
+
+.. moduleauthor:: zrong(zengrong.net)
+
+"""
+
+import os
import re
from rookout import slog
from rookout.base import (read_file, write_file)
from configparser import (ConfigParser, NoSectionError)
class PYConf(dict):
- """作为配置文件的基类
+ """基于 Python dict 的配置文件
dict 默认不适合当作配置文件对象使用。如要有下面几点不便:
#. 对于不存在的 key,会 raise KeyError 错误;
#. dict不能使用 ``.`` 语法访问。
- :class:`PYConf` 解决了这些问题,还另外提供了一些方法在使用上更加方便。
+ :class:`rookout.PYConf` 解决了这些问题,还另外提供了一些方法在使用上更加方便。
"""
@@ -42,7 +52,7 @@ def copy_from_dict(self, adict, parent=None):
:type adict: dict
:param parent: 复制到哪个父对象。
若为 None 则复制到 self 。
- :type parent: PYConf
+ :type parent: rookout.PYConf
"""
if not parent:
@@ -96,6 +106,12 @@ def read_from_file(self, path):
return True
class INIConf(ConfigParser):
+ """对 INI 格式的配置文件做了一些变化,使其可以支持列表。
+
+ 只需要将 section 的名称设置为 [@list name] 即可加入一个名称为 name 的 section。
+
+ 这个 sectioni 中的每一行都作为列表的一项。
+ """
_LIST_TMPL = r"""
@(list)? # @ or @list
View
@@ -3,7 +3,7 @@
setup(
name = "rookout",
version = "0.4.0",
- description = "A rookie's workout library by zrong",
+ description = "A rookie's workout library by zrong.",
author = "zrong",
author_email = "zrongzrong@gmail.com",
url = "http://github.com/zrong/python",

0 comments on commit a349b81

Please sign in to comment.