Re: [Geary] Geary database export

thanks Pawel, I guess you meant Cc-ing the list

Il giorno mar 19 gen 2016 alle 12:22, Pawel Chojecki <pchojecki gazeta pl> ha scritto:
Thank you Federico,

I appreciate that you comeback with answer anyway.

Actually, I have found a way to perform this export.
Listing it here in case someone else can find this useful.
Short notes: I'm a causal programmer

here comes the python script:

# -*- coding: utf-8 -*-

import sqlite3 as lite
import sys

f1=open('path_to_mbox_file', 'w+')

con = None

con = lite.connect('path_to_geary.db')
con.text_factory = str

with con:

  cur = con.cursor()
  cur.execute("SELECT * FROM MessageTable")

  while True:
    row = cur.fetchone()

    if row == None:

    print >>f1, "From ", row[10], row[2]
    print >>f1, row[14]
    print >>f1, row[15]
    print >>f1, "\n"

    print row[0]
    print "\n"


Take care

On Tuesday, January 19, 2016, Federico Bruni <fede inventati org> wrote:
Il giorno mer 30 dic 2015 alle 16:08, Pawel Chojecki <pchojecki gazeta pl> ha scritto:
Is there a way to export geary database (geary.db) to mbox type file?

I don't think so. Relevant issues:


Best Regards,
Pawel Chojecki

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