Changeset View
Changeset View
Standalone View
Standalone View
pykolab/cli/sieve/cmd_refresh.py
Show All 10 Lines | |||||
# This program is distributed in the hope that it will be useful, | # This program is distributed in the hope that it will be useful, | ||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
# GNU General Public License for more details. | # GNU General Public License for more details. | ||||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
# | # | ||||
from six import string_types | |||||
import pykolab | import pykolab | ||||
from pykolab import utils | from pykolab import utils | ||||
from pykolab.auth import Auth | from pykolab.auth import Auth | ||||
from pykolab.cli import commands | from pykolab.cli import commands | ||||
from pykolab.translate import _ | from pykolab.translate import _ | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | if not forward_active_attr == None: | ||||
if forward_active_attr in user: | if forward_active_attr in user: | ||||
forward_active = utils.true_or_false(user[forward_active_attr]) | forward_active = utils.true_or_false(user[forward_active_attr]) | ||||
else: | else: | ||||
forward_active = False | forward_active = False | ||||
if not forward_active == False: | if not forward_active == False: | ||||
forward_address_attr = conf.get('sieve', 'forward_address_attr') | forward_address_attr = conf.get('sieve', 'forward_address_attr') | ||||
if forward_address_attr in user: | if forward_address_attr in user: | ||||
if isinstance(user[forward_address_attr], basestring): | if isinstance(user[forward_address_attr], string_types): | ||||
forward_addresses = [ user[forward_address_attr] ] | forward_addresses = [ user[forward_address_attr] ] | ||||
elif isinstance(user[forward_address_attr], str): | elif isinstance(user[forward_address_attr], str): | ||||
forward_addresses = [ user[forward_address_attr] ] | forward_addresses = [ user[forward_address_attr] ] | ||||
else: | else: | ||||
forward_addresses = user[forward_address_attr] | forward_addresses = user[forward_address_attr] | ||||
if len(forward_addresses) == 0: | if len(forward_addresses) == 0: | ||||
forward_active = False | forward_active = False | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |