Beispiel #1
0
def delete_filter(filter_name):
    
    global saved_filters

    if len(saved_filters) == 0:
        ConfigUtils.read_config( saved_filters, './config/savedfilters.txt' )
            
    name = filter_name.title()
    try:
        del saved_filters[name]
        ConfigUtils.write_config( saved_filters, './config/savedfilters.txt' )
    except KeyError:
        pass
Beispiel #2
0
def save_filter(filter_name, filter_str):
    
    global saved_filters
    
    if len(saved_filters) == 0:
        ConfigUtils.read_config( saved_filters, './config/savedfilters.txt' )
            
    name = filter_name.title()
    name = name.replace(' ', '_')
    saved_filters[name] = filter_str
    
    ConfigUtils.write_config( saved_filters, './config/savedfilters.txt' )
    
    return