[EMAIL PROTECTED] writes:

> I have since *substantially* revised the code, making it
> considerably more robust and featureful.

This is great!

> b) Interactively ask the user which account the transactions apply
> to.  It appears that with MS-Money, a QIF file may contain multiple
> "sections," which means that the question may get asked multiple
> times.

This seems like the best way for now.  Later we may want to let the
user have a table listing their common mappings.  This will be useful
for people importing bank statements.

> I'm still not to the point of creating GnuCash transactions, but
> this version of the script is *substantially* better in the
> following ways:

So you're mostly handling the parsing right now?

> a) It generates output files that are nicely human-readable.
> 
> (Incidentally, I would thoroughly support the idea of the text-based
> output form creating a Scheme "define.")

Actually depending on what you mean, I'm now against the idea of a
text format data file that's just "load"ed.  This is too dangerous.  I
think we just need to read and print/write forms, no eval.  Either
that, or as someone pointed out that Guile has support for restricted
environments, that might be sufficiently safe, but we don't want
someone sticking a (remove-files 'recursive "*") or equivalent in a
data file.

> The next thing that I expect to add is functionality to build a list
> of all the "categories" that are referenced, which then obviously
> leaves the "opening" of comparing the categories in the import file
> to those existant in GnuCash.

You might also be interested in some of my recent changes.  With the
new work I've done on the scripting interface, and now that I've added
a simple "Extensions" menu where from guile you can add menu items
that execute guile functions, you can pretty easily add your
translator as a menu item with code similar to that below (this will
work once I send my current patch to Linas).  I was playing around
with adding a text export format so that's what this is headed toward,
and yes, all this does work here.  It's not psuedo-code.

  ;; This will add the given thunk to the Extensions menu.
  (gnc:extensions-menu-add-item "Import QIF"
                                "Ask for and import a QIF file."
                                (lambda ()
                                  (gnc:main-win-import-qif win)))

  (define (gnc:main-win-export-data-as-text win) 
    (let ((account-group #f)
          (session (gnc:main-window-get-session win)))

      (if session (set! account-group (gnc:session-get-group session)))

      (if (not account-group)
          (gnc:error-message-dialog
           "No account group available for text export.")
          (gnc:account-group-export-as-text account-group))))

  (define (gnc:account-group-export-as-text account-group)
    (let ((file-name (gnc:file-selection-dialog
           "Select file for text export" "")))
      (if file-name
          (gnc:debug "Running text exporting to " file-name))))

Sooner or later, I'd like to see all the menus handled from guile, but
this is a good way to get things moving, and it was a useful proof of
concept.

-- 
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body

Reply via email to