summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-03-22 09:49:59 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-03-22 09:49:59 +0100
commit79643df67b4a102da9e71b0dd7addf85b832da92 (patch)
tree5ab6ec152a891923f97750544b14cb34dbc7c7fc
parent30bf25f6e52a319d411276984ba0598c139730ba (diff)
downloadpykolab-79643df67b4a102da9e71b0dd7addf85b832da92.tar.gz
Import utils. Resolves T1138.
-rw-r--r--pykolab/cli/sieve/cmd_list.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/pykolab/cli/sieve/cmd_list.py b/pykolab/cli/sieve/cmd_list.py
index 719b372..d10517c 100644
--- a/pykolab/cli/sieve/cmd_list.py
+++ b/pykolab/cli/sieve/cmd_list.py
@@ -23,6 +23,7 @@ from urlparse import urlparse
import pykolab
+from pykolab import utils
from pykolab.auth import Auth
from pykolab.cli import commands
from pykolab.translate import _
@@ -31,7 +32,12 @@ log = pykolab.getLogger('pykolab.cli')
conf = pykolab.getConf()
def __init__():
- commands.register('list', execute, group='sieve', description=description())
+ commands.register(
+ 'list',
+ execute,
+ group='sieve',
+ description=description()
+ )
def description():
return """List a user's sieve scripts."""
@@ -82,16 +88,27 @@ def execute(*args, **kw):
import sievelib.managesieve
- sieveclient = sievelib.managesieve.Client(hostname, port, conf.debuglevel > 8)
+ sieveclient = sievelib.managesieve.Client(
+ hostname,
+ port,
+ conf.debuglevel > 8
+ )
+
sieveclient.connect(None, None, True)
- result = sieveclient._plain_authentication(admin_login, admin_password, address)
+
+ result = sieveclient._plain_authentication(
+ admin_login,
+ admin_password,
+ address
+ )
+
if not result:
print "LOGIN FAILED??"
-
+
sieveclient.authenticated = True
result = sieveclient.listscripts()
-
+
if result == None:
print "No scripts"
sys.exit(0)