myfunction.py
def validityCheckDB(self,managedb):
        """This method allows:
        A) to check if DB was actived
        B) to check if labels existed
        C) to check if polygons existed
        D) to check if every polygon had its label
        """
        try:
            result, cursorLabelCollection = managedb.listLabelDB()
            if result == False:
                print("Error: there aren't label")
                return result
            result1, cursorClassPolygon = managedb.groupByClassPolygonDBNoDate()
            if result1 == False:
                print("Error: there aren't polygon")
                return result
            for polygon in cursorClassPolygon:
                # print(polygon)
                if (polygon["_id"]["name"] == ""):
                    print("----------------------------------------")
                    print("Error: there are polygons without its label")
                    print("list of polygon without its label")
                    name = polygon["_id"]["name"]
                    result3,cursorPolygon = managedb.getPolygonOnName(name)
                    if result3 == False:
                        return result3
                    else:
                        for pol in cursorPolygon:
                            print("id", pol["_id"], "datetime", pol["properties"]["dateStr"])
                        result4 = False
                        return result4
            return True
        except Exception as e:
            print("error DB:",str(e))
            result5 = False
            return result5
This method allows:
        A) to check if DB was actived
        B) to check if labels existed
        C) to check if polygons existed
        D) to check if every polygon had its label
        
This method allows:
A) to check if DB was actived
B) to check if labels existed
C) to check if polygons existed
D) to check if every polygon had its label
This method allows : A ) to check if DB was actived B ) to check if labels existed C ) to check if polygons existed D ) to check if every polygon had its label
def validityCheckDB(self,managedb):
        try:
            result, cursorLabelCollection = managedb.listLabelDB()
            if result == False:
                print("Error: there aren't label")
                return result
            result1, cursorClassPolygon = managedb.groupByClassPolygonDBNoDate()
            if result1 == False:
                print("Error: there aren't polygon")
                return result
            for polygon in cursorClassPolygon:
                if (polygon["_id"]["name"] == ""):
                    print("----------------------------------------")
                    print("Error: there are polygons without its label")
                    print("list of polygon without its label")
                    name = polygon["_id"]["name"]
                    result3,cursorPolygon = managedb.getPolygonOnName(name)
                    if result3 == False:
                        return result3
                    else:
                        for pol in cursorPolygon:
                            print("id", pol["_id"], "datetime", pol["properties"]["dateStr"])
                        result4 = False
                        return result4
            return True
        except Exception as e:
            print("error DB:",str(e))
            result5 = False
            return result5
def validityCheckDB ( self , managedb ) : try : result , cursorLabelCollection = managedb . listLabelDB ( ) if result == False : print ( "Error: there aren't label" ) return result result1 , cursorClassPolygon = managedb . groupByClassPolygonDBNoDate ( ) if result1 == False : print ( "Error: there aren't polygon" ) return result for polygon in cursorClassPolygon : if ( polygon [ "_id" ] [ "name" ] == "" ) : print ( "----------------------------------------" ) print ( "Error: there are polygons without its label" ) print ( "list of polygon without its label" ) name = polygon [ "_id" ] [ "name" ] result3 , cursorPolygon = managedb . getPolygonOnName ( name ) if result3 == False : return result3 else : for pol in cursorPolygon : print ( "id" , pol [ "_id" ] , "datetime" , pol [ "properties" ] [ "dateStr" ] ) result4 = False return result4 return True except Exception as e : print ( "error DB:" , str ( e ) ) result5 = False return result5
This method allows:
A) to check if DB was actived
B) to check if labels existed
C) to check if polygons existed
D) to check if every polygon had its label
This method allows : A ) to check if DB was actived B ) to check if labels existed C ) to check if polygons existed D ) to check if every polygon had its label
"""This method allows:
        A) to check if DB was actived
        B) to check if labels existed
        C) to check if polygons existed
        D) to check if every polygon had its label
        """ # print(polygon)
self
managedb