Update of /cvsroot/pybot/pybot/pybot
In directory sc8-pr-cvs1:/tmp/cvs-serv15913/pybot
Modified Files:
__init__.py
Added Files:
sqlitedb.py
Log Message:
- New xmlrpc module.
- New testadora module, supporting compile time command, for now. This is
useful for Conectiva only.
- Accept "(remove|delete|del) permission" as well.
- Implemented sqlite db storage.
- Use sqlite storage to maintain logs.
- Adopted re system, and added a command to show loaded modules.
--- NEW FILE: sqlitedb.py ---
# Copyright (c) 2000-2001 Gustavo Niemeyer <nie...@co...>
#
# This file is part of pybot.
#
# pybot is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# pybot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pybot; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from pybot import config
import sqlite
class SQLiteDB:
def __init__(self):
self._path = config.get("sqlite", "path")
self._conn = sqlite.connect(self._path)
self._conn.autocommit = 1
self.error = sqlite.DatabaseError
def cursor(self):
return self._conn.cursor()
# vim:ts=4:sw=4:et
Index: __init__.py
===================================================================
RCS file: /cvsroot/pybot/pybot/pybot/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** __init__.py 5 May 2003 20:47:18 -0000 1.3
--- __init__.py 8 May 2003 18:30:59 -0000 1.4
***************
*** 23,31 ****
from pybot.hook import Hooks
from pybot.main import Main
from ConfigParser import ConfigParser
import os
! global main, modls, servers, options, hooks, mm, rm, config
hooks = Hooks()
--- 23,32 ----
from pybot.hook import Hooks
from pybot.main import Main
+ from pybot.sqlitedb import SQLiteDB
from ConfigParser import ConfigParser
import os
! global main, modls, servers, options, hooks, mm, rm, config, db
hooks = Hooks()
***************
*** 39,42 ****
--- 40,45 ----
config = ConfigParser()
defaults = config.defaults()
+
+ db = SQLiteDB()
if os.path.isfile("./pybot.conf") and os.path.isdir("pybot"):
|