def add_item_to_watch(self, sobject_item):
    watch_dict = self.get_watch_dict_by_skey(sobject_item.get_search_key())
    all_folders_exists = True
    base_dirs = env_tactic.get_all_base_dirs()
    for (key, val) in base_dirs:
        if (val['value'][4] and (val['value'][3] in watch_dict['rep'])):
            abs_path = u'{0}/{1}'.format(val['value'][0], watch_dict['path'])
            if (not os.path.exists(gf.form_path(abs_path))):
                all_folders_exists = False
                dl.warning('Folders structure for: {0} is not created. Watch will be ignored.'.format(abs_path), group_id='watch_folders_ui')
    if all_folders_exists:
        self.watched_items.add(sobject_item)
        self.fill_watch_folders_tree_widget()
def add_item_to_watch(self, sobject_item):
    watch_dict = self.get_watch_dict_by_skey(sobject_item.get_search_key())
    all_folders_exists = True
    base_dirs = env_tactic.get_all_base_dirs()
    for (key, val) in base_dirs:
        if (val['value'][4] and (val['value'][3] in watch_dict['rep'])):
            abs_path = u'{0}/{1}'.format(val['value'][0], watch_dict['path'])
            if (not os.path.exists(gf.form_path(abs_path))):
                all_folders_exists = False
                dl.warning('Folders structure for: {0} is not created. Watch will be ignored.'.format(abs_path), group_id='watch_folders_ui')
    if all_folders_exists:
        self.watched_items.add(sobject_item)
        self.fill_watch_folders_tree_widget()