Changeset View
Changeset View
Standalone View
Standalone View
pykolab/cli/cmd_remove_mailaddress.py
Show All 11 Lines | |||||
# 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 __future__ import print_function | |||||
import sys | import sys | ||||
import commands | import commands | ||||
import pykolab | import pykolab | ||||
from pykolab.auth import Auth | from pykolab.auth import Auth | ||||
from pykolab import utils | from pykolab import utils | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if isinstance(recipients, basestring): | ||||
auth.set_entry_attributes(domain, recipient, replace_attributes) | auth.set_entry_attributes(domain, recipient, replace_attributes) | ||||
else: | else: | ||||
if email_address == attributes[attribute]: | if email_address == attributes[attribute]: | ||||
auth.set_entry_attributes(domain, recipient, {attribute: None}) | auth.set_entry_attributes(domain, recipient, {attribute: None}) | ||||
pass | pass | ||||
else: | else: | ||||
print >> sys.stderr, _("Found the following recipients:") | print(_("Found the following recipients:"), file=sys.stderr) | ||||
for recipient in recipients: | for recipient in recipients: | ||||
print recipient | print(recipient) |