Megatest

Diff
Login

Differences From Artifact [edae8fdba8]:

To Artifact [5e94ada62d]:


133
134
135
136
137
138
139
































140
141
142
143
144
145
146
	(print (sxml-serializer#serialize-sxml sht-rem))))
    (let ((sheet-names (map (lambda (sheet)
			      (sheet->txtdb sheet targdir))
			    sheets)))
      (with-output-to-file (conc targdir "/sheet-names.cfg")
	(lambda ()
	  (map print sheet-names))))))

































#|  
 (define x (txtdb:read-gnumeric-xml "testdata-stripped.xml"))



;; Write out sxml







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
	(print (sxml-serializer#serialize-sxml sht-rem))))
    (let ((sheet-names (map (lambda (sheet)
			      (sheet->txtdb sheet targdir))
			    sheets)))
      (with-output-to-file (conc targdir "/sheet-names.cfg")
	(lambda ()
	  (map print sheet-names))))))

(define (read-gnumeric-file fname)
  (if (not (string-match (regexp ".*.gnumeric$") fname))
      (begin
	(print "ERROR: Attempt to import gnumeric file with extention other than .gnumeric")
	(exit))
      (let ((tmpf (create-temporary-file (pathname-strip-directory fname))))
	(system (conc " gunzip > " tmpf " < " fname))
	(let ((res (txtdb:read-gnumeric-xml tmpf)))
	  (delete-file tmpf)
	  res))))

(define (import-gnumeric-file fname targdir)
  (extract-txtdb (read-gnumeric-file fname) targdir))

(define (txtdb-export dbdir fname)
  (let ((sxml-dat (txtdb->sxml dbdir))
	(tmpf     (create-temporary-file (pathname-strip-directory fname))))
    (with-output-to-file tmpf
      (lambda ()
	(print (sxml-serializer#serialize-sxml sxml-dat))))
    (system (conc "gzip " tmpf))
    (file-copy tmpf fname)
    (delete-file tmpf)))
    
(define (txtdb->sxml dbdir)
  ;; Read sheets list
  ;; Read sheets
  ;; Read xml for each sheet
  ;; Read meta data xml
  ;; Construct the final sxml and return it
  #f)

#|  
 (define x (txtdb:read-gnumeric-xml "testdata-stripped.xml"))



;; Write out sxml