Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(56)  |  Call(49)  |  Derive(0)  |  Import(7)

        def statement(str, ph_mark):
    if "?" == ph_mark or "?" not in str:
        printdbg(str)
        return str

    tokens = str.split("'")
    for i in range(0, len(tokens), 2):
        tokens[i] = tokens[i].replace("?", ph_mark)

    retval = "'".join(tokens)
    printdbg(retval)

    return retval
        


src/c/v/CVSAnalY-HEAD/pycvsanaly2/DBContentHandler.py   CVSAnalY(Download)

src/m/i/MininGit-HEAD/pycvsanaly2/DBContentHandler.py   MininGit(Download)
 
from ContentHandler import ContentHandler
from Database import (DBRepository, DBLog, DBFile, DBFileLink,
                      DBAction, DBFileCopy, DBBranch, DBPerson, DBTag,
                      DBTagRev, statement, MysqlDatabase)
    def repository(self, uri):
        cursor = self.cursor
        cursor.execute(statement("SELECT id from repositories where uri = ?",
                                 self.db.place_holder), (uri,))
        self.repo_id = cursor.fetchone()[0]
                where id = (select max(id) from scmlog
                            where repository_id = ?)"""
        cursor.execute(statement(query, self.db.place_holder), (self.repo_id,))
        rs = cursor.fetchone()
        if rs is not None:
                    import MySQLdb
                    try:
                        cursor.execute(statement(DBAction.__insert__,
                                             self.db.place_holder), 
                                             action_tuple)
                            pass
                else:
                    cursor.execute(statement(DBAction.__insert__,
                                             self.db.place_holder), 
                                             action_tuple)

src/m/i/MininGit-HEAD/pycvsanaly2/main.py   MininGit(Download)
from ParserFactory import (create_parser_from_logfile,
    create_parser_from_repository)
from Database import (create_database, TableAlreadyExists, AccessDenied,
    DatabaseNotFound, DatabaseDriverNotSupported, DBRepository, statement,
    initialize_ids, DatabaseException)
    if db_exists:
        printdbg("Database exists, so looking for existing repository")
        cursor.execute(statement("SELECT id from repositories where uri = ?",
                                 db.place_holder), (uri,))
        rep = cursor.fetchone()
        cursor = cnn.cursor()
        rep = DBRepository(None, uri, name, repo.get_type())
        cursor.execute(statement(DBRepository.__insert__, db.place_holder),
                       (rep.id, rep.uri, rep.name, rep.type))
        cursor.close()

src/c/v/CVSAnalY-HEAD/pycvsanaly2/main.py   CVSAnalY(Download)

src/m/i/MininGit-HEAD/pycvsanaly2/DBTempLog.py   MininGit(Download)
 
from ContentHandler import ContentHandler
from Database import (SqliteDatabase, MysqlDatabase, TableAlreadyExists, 
                      statement, ICursor)
from Repository import Commit
 
            if n_commits == 50:
                cursor.executemany(statement("INSERT into _temp_log " + \
                    "(rev, date, object) values (?, ?, ?)", 
                    self.db.place_holder), commits)
 
        if commits:
            cursor.executemany(statement("INSERT into _temp_log " + \
                    "(rev, date, object) values (?, ?, ?)", 
                    self.db.place_holder), commits)
        # We need to split the query to save memory
        icursor = ICursor(cnn.cursor(), self.INTERVAL_SIZE)
        icursor.execute(statement(query, self.db.place_holder))
        rs = icursor.fetchmany()
        while rs:

src/c/v/CVSAnalY-HEAD/pycvsanaly2/DBTempLog.py   CVSAnalY(Download)

src/m/i/MininGit-HEAD/pycvsanaly2/DBDeletionHandler.py   MininGit(Download)
#       Chris Lewis <cflewis@soe.ucsc.edu>
 
from Database import (execute_statement, get_repo_id, statement, RepoNotFound)
from utils import printdbg, printout, printerr
 
        try:
            delete_cursor = self.connection.cursor()
            execute_statement(statement(delete_statement, 
                                        self.db.place_holder),
                              params, delete_cursor,