示例#1
0
def getEndSignal(mysql: MySQLWrapper):
    mysql.query("SELECT Value FROM Signals WHERE SignalName='End';")
    results = mysql.fetchResults()

    if results is None or results[0][0] == 1:
        return True
    else:
        return False
示例#2
0
def getRefreshTime(mysql: MySQLWrapper):
    mysql.query("SELECT Value FROM Signals WHERE SignalName='Refresh';")
    results = mysql.fetchResults()

    if results is None:
        return 30
    else:
        return results[0][0]
示例#3
0
    def getSQLID(self, mysql: MySQLWrapper):
        mysql.query(
            "SELECT ThreadID FROM Threads WHERE HLTVID=%s;",
            (self.hltvID,)
        )

        result = mysql.fetchResults()

        if result is None:
            return None
        else:
            return result[0][0]
示例#4
0
    def getSQLID(self, mysql: MySQLWrapper):
        mysql.query(
            "SELECT PostID FROM Posts WHERE HLTVID=%s;",
            (self.getHLTVID(),)
        )

        result = mysql.fetchResults()

        if result is None:
            return None
        else:
            return result[0][0]
示例#5
0
def getForums(mysql: MySQLWrapper):

    mysql.query("SELECT ForumID, HLTVID, Name FROM Forums;")
    results = mysql.fetchResults()

    if results is None:
        return []
    else:
        forums = []

        for row in results:
            forumInfo = Forum(
                sqlID = row[0], hltvID = row[1], name = row[2]
            )

            if '/' in forumInfo.hltvID:
                forums += [forumInfo]
        
        return forums