Example #1
0
def buildCareer(conn, cursor, userId, userName, start, stop, ul, page):
    """get career summaries for UIDs"""
    page.career = Template(file="./templates/career.tmpl")
    page.career.career = list()
    for userId in ul.keys():
        userList = {userId: " "}
        role = ul[userId]["role"]
        userName = str(osmstat.userName(conn, cursor, userId)[0][0]).encode("utf8")
        page.career.career.append(osmstat.summary(conn, cursor, userId, userName, role, start, stop, userList))
    """do we need a total-line for careers?"""
    if len(ul) >= 2:
        for x in ul.keys():
            userList[x] = " "
        userId = 9999999  # use a fake, high UID for the total line.
        role = "combined"  # keyword to display total line in career template
        page.career.career.append(osmstat.summary(conn, cursor, userId, userName, role, start, stop, userList))
Example #2
0
def osmUser():
    """main routine start here"""
    """get command line arguments"""
    (ul, conn, userId, fileName, debug, akaId) = parseArgs()
    """get some constants / globals"""
    (generator, swVersion, t, start, stop, total) = setConstants()
    """open connection to db"""
    cursor = conn.cursor()
    userName = str(osmstat.userName(conn, cursor, userId)[0][0]).encode("utf8")
    """build the page with Cheetah Templates"""
    page = buildSinglePage(conn, cursor, userId, userName, start, stop, total, ul)

    conn.close()

    if debug:
        print page

    saveFile(page, fileName, userName)