gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24332 - monkey/trunk/seaspider


From: gnunet
Subject: [GNUnet-SVN] r24332 - monkey/trunk/seaspider
Date: Tue, 16 Oct 2012 00:15:43 +0200

Author: teichm
Date: 2012-10-16 00:15:43 +0200 (Tue, 16 Oct 2012)
New Revision: 24332

Modified:
   monkey/trunk/seaspider/seasp2_convert
Log:
seasp2_convert SystemGlobal support improved

Modified: monkey/trunk/seaspider/seasp2_convert
===================================================================
--- monkey/trunk/seaspider/seasp2_convert       2012-10-15 21:30:22 UTC (rev 
24331)
+++ monkey/trunk/seaspider/seasp2_convert       2012-10-15 22:15:43 UTC (rev 
24332)
@@ -79,11 +79,18 @@
                print 'could not read file: ',filename
                infile.close()
                return
+       
+       (tmp, ext) = os.path.splitext(filename)
+       (crap, filename) = os.path.split(tmp)
+       filename += '.c'
 
        lines = infile.readlines(10000)
        while lines:
                for line in lines:
-                       (rowtype, remainder) = line.split(': ', 1)
+                       try:
+                               (rowtype, remainder) = line.split(': ', 1)
+                       except ValueError:
+                               rowtype = "wrong line format: " + line
                        if rowtype == 'SystemGlobal':
                                (rowfile, rowglob) = remainder.split(':', 1)
                                (lineno, globalvar) = rowglob.split(' ', 1)
@@ -96,7 +103,8 @@
                                vals = (rowfile, globalvar, lineno, 32767, 0)
                                sql_cur.execute('INSERT INTO Expression VALUES 
(NULL,?,?,?,?,?)', vals)
                        elif rowtype == 'Function':
-                               print 'nothing to do for entry type Function'
+                               pass
+#                              print 'nothing to do for entry type Function'
                        elif rowtype == 'Parameter':
                                if prevtype == 'Function' or prevtype == 
'Parameter':
                                        (rowfile, rowpar) = 
remainder.split(':', 1)
@@ -130,6 +138,7 @@
                        prevtype = rowtype
                sql_conn.commit()
                lines = infile.readlines(10000)
+       infile.close()
 
 
 # traverses all .sea files in the input folder




reply via email to

[Prev in Thread] Current Thread [Next in Thread]