Commit ee747948 ee7479485f6b252eb131533a6a7d1ab20283719e by Wojciech Polak

Remove more old debug leftovers from the Python interface.

1 parent 2e6b4a7f
...@@ -32,10 +32,7 @@ python_check_msg (mu_message_t msg, struct mu_auth_data *auth, ...@@ -32,10 +32,7 @@ python_check_msg (mu_message_t msg, struct mu_auth_data *auth,
32 32
33 if (!log_to_stderr) 33 if (!log_to_stderr)
34 { 34 {
35 mu_debug_t debug; 35 /* FIXME */
36 mu_diag_get_debug (&debug);
37 mu_py_capture_stderr (debug);
38 mu_py_capture_stdout (debug);
39 } 36 }
40 37
41 py_msg = PyMessage_NEW (); 38 py_msg = PyMessage_NEW ();
......
...@@ -110,7 +110,6 @@ mu_py_attach_modules (void) ...@@ -110,7 +110,6 @@ mu_py_attach_modules (void)
110 _mu_py_attach_attribute (); 110 _mu_py_attach_attribute ();
111 _mu_py_attach_auth (); 111 _mu_py_attach_auth ();
112 _mu_py_attach_body (); 112 _mu_py_attach_body ();
113 _mu_py_attach_debug ();
114 _mu_py_attach_envelope (); 113 _mu_py_attach_envelope ();
115 _mu_py_attach_header (); 114 _mu_py_attach_header ();
116 _mu_py_attach_filter (); 115 _mu_py_attach_filter ();
......
...@@ -64,7 +64,6 @@ extern void _mu_py_attach_address (void); ...@@ -64,7 +64,6 @@ extern void _mu_py_attach_address (void);
64 extern void _mu_py_attach_attribute (void); 64 extern void _mu_py_attach_attribute (void);
65 extern void _mu_py_attach_auth (void); 65 extern void _mu_py_attach_auth (void);
66 extern void _mu_py_attach_body (void); 66 extern void _mu_py_attach_body (void);
67 extern void _mu_py_attach_debug (void);
68 extern void _mu_py_attach_envelope (void); 67 extern void _mu_py_attach_envelope (void);
69 extern void _mu_py_attach_header (void); 68 extern void _mu_py_attach_header (void);
70 extern void _mu_py_attach_filter (void); 69 extern void _mu_py_attach_filter (void);
......
...@@ -22,7 +22,6 @@ pythonsite_PYTHON=\ ...@@ -22,7 +22,6 @@ pythonsite_PYTHON=\
22 attribute.py \ 22 attribute.py \
23 auth.py \ 23 auth.py \
24 body.py \ 24 body.py \
25 debug.py \
26 envelope.py \ 25 envelope.py \
27 filter.py \ 26 filter.py \
28 folder.py \ 27 folder.py \
......
...@@ -41,7 +41,6 @@ __all__ = ( ...@@ -41,7 +41,6 @@ __all__ = (
41 "attribute", 41 "attribute",
42 "auth", 42 "auth",
43 "body", 43 "body",
44 "debug",
45 "envelope", 44 "envelope",
46 "filter", 45 "filter",
47 "folder", 46 "folder",
......
1 # GNU Mailutils -- a suite of utilities for electronic mail
2 # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 3 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General
15 # Public License along with this library. If not, see
16 # <http://www.gnu.org/licenses/>.
17
18 from mailutils.c_api import debug
19 from mailutils.error import DebugError
20
21 MU_DEBUG_ERROR = 0
22 MU_DEBUG_TRACE0 = 1
23 MU_DEBUG_TRACE = MU_DEBUG_TRACE0
24 MU_DEBUG_TRACE1 = 2
25 MU_DEBUG_TRACE2 = 3
26 MU_DEBUG_TRACE3 = 4
27 MU_DEBUG_TRACE4 = 5
28 MU_DEBUG_TRACE5 = 6
29 MU_DEBUG_TRACE6 = 7
30 MU_DEBUG_TRACE7 = 8
31 MU_DEBUG_PROT = 9
32
33 class Debug:
34 def __init__ (self, dbg):
35 self.dbg = dbg
36
37 def __del__ (self):
38 del self.dbg
39
40 def set_level (self, level=MU_DEBUG_PROT):
41 status = debug.set_level (self.dbg, level)
42 if status:
43 raise DebugError (status)
...@@ -20,7 +20,6 @@ from mailutils.c_api import mailbox ...@@ -20,7 +20,6 @@ from mailutils.c_api import mailbox
20 from mailutils import message 20 from mailutils import message
21 from mailutils import folder 21 from mailutils import folder
22 from mailutils import url 22 from mailutils import url
23 from mailutils import debug
24 from mailutils.error import MailboxError 23 from mailutils.error import MailboxError
25 24
26 class MailboxBase: 25 class MailboxBase:
...@@ -150,13 +149,6 @@ class MailboxBase: ...@@ -150,13 +149,6 @@ class MailboxBase:
150 raise MailboxError (status) 149 raise MailboxError (status)
151 return folder.Folder (fld) 150 return folder.Folder (fld)
152 151
153 def get_debug (self):
154 """Get the Debug object."""
155 status, dbg = mailbox.get_debug (self.mbox)
156 if status:
157 raise MailboxError (status)
158 return debug.Debug (dbg)
159
160 def get_url (self): 152 def get_url (self):
161 """Get the Url object.""" 153 """Get the Url object."""
162 status, u = mailbox.get_url (self.mbox) 154 status, u = mailbox.get_url (self.mbox)
...@@ -187,8 +179,6 @@ class MailboxBase: ...@@ -187,8 +179,6 @@ class MailboxBase:
187 return self.get_folder () 179 return self.get_folder ()
188 elif name == 'url': 180 elif name == 'url':
189 return self.get_url () 181 return self.get_url ()
190 elif name == 'debug':
191 return self.get_debug ()
192 else: 182 else:
193 raise AttributeError, name 183 raise AttributeError, name
194 184
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
17 17
18 from mailutils.c_api import mailer 18 from mailutils.c_api import mailer
19 from mailutils import address 19 from mailutils import address
20 from mailutils import debug
21 from mailutils.error import MailerError 20 from mailutils.error import MailerError
22 21
23 class Mailer: 22 class Mailer:
...@@ -31,12 +30,6 @@ class Mailer: ...@@ -31,12 +30,6 @@ class Mailer:
31 mailer.destroy (self.mlr) 30 mailer.destroy (self.mlr)
32 del self.mlr 31 del self.mlr
33 32
34 def __getattr__ (self, name):
35 if name == 'debug':
36 return self.get_debug ()
37 else:
38 raise AttributeError, name
39
40 def open (self, flags=0): 33 def open (self, flags=0):
41 status = mailer.open (self.mlr, flags) 34 status = mailer.open (self.mlr, flags)
42 if status: 35 if status:
...@@ -55,9 +48,3 @@ class Mailer: ...@@ -55,9 +48,3 @@ class Mailer:
55 status = mailer.send_message (self.mlr, msg.msg, frm, to) 48 status = mailer.send_message (self.mlr, msg.msg, frm, to)
56 if status: 49 if status:
57 raise MailerError (status) 50 raise MailerError (status)
58
59 def get_debug (self):
60 status, dbg = mailer.get_debug (self.mlr)
61 if status:
62 raise MailerError (status)
63 return debug.Debug (dbg)
......
...@@ -29,21 +29,6 @@ class Machine: ...@@ -29,21 +29,6 @@ class Machine:
29 sieve.machine_destroy (self.mach) 29 sieve.machine_destroy (self.mach)
30 del self.mach 30 del self.mach
31 31
32 def set_debug (self, fnc):
33 status = sieve.set_debug (self.mach, fnc)
34 if status:
35 raise SieveMachineError (status)
36
37 def set_error (self, fnc):
38 status = sieve.set_error (self.mach, fnc)
39 if status:
40 raise SieveMachineError (status)
41
42 def set_parse_error (self, fnc):
43 status = sieve.set_parse_error (self.mach, fnc)
44 if status:
45 raise SieveMachineError (status)
46
47 def set_logger (self, fnc): 32 def set_logger (self, fnc):
48 status = sieve.set_logger (self.mach, fnc) 33 status = sieve.set_logger (self.mach, fnc)
49 if status: 34 if status:
......