[mirrorbrain-commits] r8044 - in /trunk/mirrordoctor: mb/conn.py mirrordoctor.py

From: <poeml_at_mirrorbrain.org>
Date: Tue, 04 May 2010 16:46:29 -0000
Author: poeml
Date: Tue May  4 18:46:28 2010
New Revision: 8044

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8044&view=rev
Log:
mb edit:
- Bugs that occur when copying and pasting data have been fixed (reported in issue #30).

Modified:
    trunk/mirrordoctor/mb/conn.py
    trunk/mirrordoctor/mirrordoctor.py

Modified: trunk/mirrordoctor/mb/conn.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mb/conn.py?rev=8044&r1=8043&r2=8044&view=diff
==============================================================================
--- trunk/mirrordoctor/mb/conn.py (original)
+++ trunk/mirrordoctor/mb/conn.py Tue May  4 18:46:28 2010
_at_@ -255,6 +255,8 @@
                 new_attrs[a] = m.group(1).rstrip()
             else:
                 new_attrs[a] = None
+        else:
+            new_attrs[a] = None
 
     # the comment field is formatted differently
     comment_delim = '---------- comments ----------'

Modified: trunk/mirrordoctor/mirrordoctor.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mirrordoctor.py?rev=8044&r1=8043&r2=8044&view=diff
==============================================================================
--- trunk/mirrordoctor/mirrordoctor.py (original)
+++ trunk/mirrordoctor/mirrordoctor.py Tue May  4 18:46:28 2010
_at_@ -554,14 +554,19 @@
             new_dict = mb.conn.servertext2dict(new)
 
             for i in mb.conn.server_editable_attrs:
-                if str(old_dict[i]) != new_dict[i]:
+                if not new_dict[i]:
+                    continue
+                elif str(old_dict[i]) != new_dict[i]:
                     print """changing %s from '%s' to '%s'""" \
                             % (i, old_dict[i], new_dict[i])
                     a = new_dict[i]
                     if a == 'False': a = False
                     if a == 'True': a = True
                     if type(getattr(mirror, i)) in [type(1L), type(1), bool]:
-                        a = int(a)
+                        try:
+                            a = int(a)
+                        except ValueError:
+                            a = 0
                     setattr(mirror, i, a)
 
 




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue May 04 2010 - 16:46:32 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT