from rosreestrXml.ui.MainForm import findProperties
from rosreestrXml.ui.tools.KPT.kptTools.DbKptDirectory import KptСatalog


def getPropertyForestDeclaration( db):
    values_db = db.GetPropertiesKpt('forest_declaration_style')
    item_value = findProperties(values_db, 'location')

    prop_ForestDeclaration = {}
    prop_ForestDeclaration['locations'] = {}
    prop_ForestDeclaration['locations']['enable'] = True
    prop_ForestDeclaration['locations']['style'] = "Pen (2, 2, 8388608) Brush (63, 0)"
    if item_value is not None:
        prop_ForestDeclaration['locations']['enable'] = item_value['enable']
        prop_ForestDeclaration['locations']['style'] =item_value['style']
    prop_ForestDeclaration['points'] = {}
    prop_ForestDeclaration['points']['enable'] = True
    prop_ForestDeclaration['points']['style'] = "Symbol (49, 65280, 12)"
    item_value = findProperties(values_db, 'points')
    if item_value is not None:
        prop_ForestDeclaration['points']['enable'] = item_value['enable']
        prop_ForestDeclaration['points']['style'] = item_value['style']
    return prop_ForestDeclaration
db=KptСatalog()
#style_prop=db.GetPropertiesKpt('kpt_10_style')
#findProperties(style_prop,'SpatialData')
getPropertyForestDeclaration(db)
db.close()