[Commits] (jeffrey) Added functionality to import Notes.

commits at osafoundation.org commits at osafoundation.org
Mon May 3 12:19:34 PDT 2004


Commit by: jeffrey
Modified files:
osaf/chandler/Chandler/contacts.csv 1.1 1.2
osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py 1.2 1.3
osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py 1.1 1.2

Log message:
Added functionality to import Notes.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/contacts.csv.diff?r1=text&tr1=1.1&r2=text&tr2=1.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2

Index: osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py:1.1 osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py:1.2
--- osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py:1.1	Fri Apr 23 17:08:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/MapXML.py	Mon May  3 12:19:03 2004
@@ -1,7 +1,7 @@
 """Parse XML file to create a mapping object."""
 
-__revision__  = "$Revision: 1.1 $"
-__date__      = "$Date: 2004/04/24 00:08:59 $"
+__revision__  = "$Revision: 1.2 $"
+__date__      = "$Date: 2004/05/03 19:19:03 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -87,7 +87,10 @@
                 elif name == 'StringKey':
                     key=node.getContent()
                     name=self.lastXMLAttr
-                    self.stack.append(ImportMap.StringValue(key, name))
+                    parent=self.stack[-1]
+                    if name == None:#list of strings case
+                        name = parent.name
+                    self.stack.append(ImportMap.StringValue(key, name, parent))
                 elif name == 'DateKey':
                     key=node.getContent()
                     name=self.lastXMLAttr
@@ -102,7 +105,6 @@
                     keys=[i.getContent() for i in node.xpathEval("StringKey")]
                     name=self.lastXMLAttr
                     self.stack.append(ImportMap.ConcatKeys(keys, name))
-                #fixme, If, Constant
                 self.emptySavedNode()
                 self.reader.Next()
                    

Index: osaf/chandler/Chandler/contacts.csv
diff -u osaf/chandler/Chandler/contacts.csv:1.1 osaf/chandler/Chandler/contacts.csv:1.2
--- osaf/chandler/Chandler/contacts.csv:1.1	Mon Mar  8 10:35:20 2004
+++ osaf/chandler/Chandler/contacts.csv	Mon May  3 12:19:02 2004
@@ -1,4 +1,4 @@
 Title,First Name,Middle Name,Last Name,Suffix,Company,Department,Job Title,Business Street,Business Street 2,Business Street 3,Business City,Business State,Business Postal Code,Business Country,Home Street,Home Street 2,Home Street 3,Home City,Home State,Home Postal Code,Home Country,Other Street,Other Street 2,Other Street 3,Other City,Other State,Other Postal Code,Other Country,Assistant's Phone,Business Fax,Business Phone,Business Phone 2,Callback,Car Phone,Company Main Phone,Home Fax,Home Phone,Home Phone 2,ISDN,Mobile Phone,Other Fax,Other Phone,Pager,Primary Phone,Radio Phone,TTY/TDD Phone,Telex,Account,Anniversary,Assistant's Name,Billing Information,Birthday,Categories,Children,Directory Server,E-mail Address,E-mail Type,E-mail Display Name,E-mail 2 Address,E-mail 2 Type,E-mail 2 Display Name,E-mail 3 Address,E-mail 3 Type,E-mail 3 Display Name,Gender,Government ID Number,Hobby,Initials,Internet Free Busy,Keywords,Language,Location,Manager's Name,Mileage,Notes,Offic!
e Location,Organizational ID Number,PO Box,Priority,Private,Profession,Referred By,Sensitivity,Spouse,User 1,User 2,User 3,User 4,Web Page
-,John,,Doe,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,312-444-4444,,,,,,,,,,,,0/0/00,,,0/0/00,,,,john at doe.com,SMTP,john at doe.com,,,,,,,Unspecified,,,,,,,,,,,,,,Normal,FALSE,,,Normal,,,,,,
+,John,a,Doe,Senior,Kaboom,Safety,Engineer,1 Nowhere Lane,,,Somewhere,SO,12345,USA,2 Elsewhere Lane,,,Down,DO,23456,,,,,,,,,,414-555-5fax,444-234-5678,,,,,,312-444-4444,,,312-555-5555,,,,,,,,,0/0/00,,,5/12/1977,,"Tim, Tony, Tom",,john at doe.com,SMTP,john at doe.com,john2 at doe.com,,,,,,Unspecified,,,,,,,,,,"This is a note.  Yes, a note.",,,,Normal,FALSE,,,Normal,,,,,,http://nowhere.com
 ,Jane,,Doe,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,312-444-4444,,,,,,,,,,,,0/0/00,,,0/0/00,,,,jane at doe.com,SMTP,jane at doe.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
 ,,,Smith,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0/0/00,,,0/0/00,,,,jacky at smith.com,SMTP,jacky at smith.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Index: osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py:1.2 osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py:1.3
--- osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py:1.2	Mon May  3 08:53:28 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/utils/imports/ImportMap.py	Mon May  3 12:19:03 2004
@@ -1,7 +1,7 @@
 """ImportMap trees map dictionaries into connected repository Items."""
 
-__revision__  = "$Revision: 1.2 $"
-__date__      = "$Date: 2004/05/03 15:53:28 $"
+__revision__  = "$Revision: 1.3 $"
+__date__      = "$Date: 2004/05/03 19:19:03 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -18,7 +18,7 @@
     @ivar kind: If this is the root of the mapping tree, the kind of the tree.
         Otherwise None.
     
-    """       
+    """
     def process(self, itemDict):
         """Return a filled item, or None if all children map to empty keys.
     
@@ -109,13 +109,15 @@
 
 class StringValue(ImportMap):
     """Map for a key whose value is a string."""
-    def __init__(self, key, name):
+    def __init__(self, key, name, parentMap):
         self.key=key
         self.name=name
+        self.kind=None
+        self.parentMap=parentMap
 
     def process(self, itemDict):
         if itemDict[self.key]:
-            return itemDict[self.key]
+            return self.getType().makeValue(itemDict[self.key])
         else:
             return None
 



More information about the Commits mailing list