db: mysqldb: Fix the UnboundLocalError

The code out of try/except peer will not be treated as part of the
block. Thus the return here didn't work with the function but ran
as a single command. 'res' was not a global variable, so the
reture would cause a UnboundLocalError.

Signed-off-by: GuofengLiu <lgf612@sina.com>
data: add arguments for two methods

Add 'field' argument for both lowestByDate() and highestByDate()
 to extend usability.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
db:mysqldb: introduce two new methods.

1) ifTableExist() returns if a table does exist.
2) createTableTemplate() creates a table using templates.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
dataMgr: introduce data manager subsystem.

Add two importers.
1) importer.py contains 'Import' class which is proposed to be the
   super class for all child Importers.
2) Introduce whImporter to support WenHua format data records.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
test: add test for dataMgr/importers.

Add test because introduced new dataMgr subsystem.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
dataMgr:importer: adjust arguments for partReimportTo()

Adjust argument 'tTo' for partReimportTo to use 'None' as default.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
dataMgr:whImporter: rename wenhuaNewImport()

Rename wenhuaNewImport() as newImport(), so to keep consistency
with Import super class.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:turtle: add turtle framework

Turtle framework provides a set of basic methods, e.g, tr, atr and
attributes which might be used by child strategies. This framework
aims to save time and code to rewrite a modified turtle strategy
(child strategy), so any child strategy also should inherit this
class and redefine some keys methods to drive this framework to run.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
display: display: Create the display subsystem

1) Make a display subsystem. This subsystem will contain the
   modules for displaying data in the CML and GUI.
2) Create a display module. Implemented the data display formated
   in CML console. Currently only support give color to bash.
3) Defined a new class COLORS, contain a templete structure and
   the method of add templete.
4) Defined a new class Print_Clr, which is the children of COLORS.
   This class could display formated data in the CML console.
5) Write the test for the two classes and their methods.
Merge branch 'gliu-dev' of github.com:ruanzhengwang-org/winfuture into gliu-dev