From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlef Steuer Subject: Translator: remind2org Date: Sat, 12 Jan 2008 17:55:02 +0100 Message-ID: <20080112175502.0fb06b66@linux.site> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JDjiL-0002TP-2F for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 12:00:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JDjiJ-0002ST-JN for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 12:00:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDjiJ-0002SP-9C for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 12:00:07 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JDjiI-0005cD-QV for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 12:00:07 -0500 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1JDjiE-0003Gz-3N for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 17:00:02 +0000 Received: from e176076149.adsl.alicedsl.de ([85.176.76.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2008 17:00:02 +0000 Received: from detlef.steuer by e176076149.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2008 17:00:02 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, remind (http://www.roaringpenguin.com/products/remind) is a very powerful command line calendaring program. Its features superseed the possibilities of orgmode in the area of date specifying, so that I want to use it combined with orgmode. Using the script below I'm able use remind and incorporate its output in my agenda views. The default of using 13 months look ahead is easily changed. It just happens I sometimes like to look a year into the future. :-) Any comments welcome! Be friendly ;-) , that's my first python program ever. So it may be stupid as hell and bad python style. There is no sophisticated logic to get nice orgmode output. I only cared to get all dates. Nevertheless it does what I need. Hope someone finds this useful. detlef Carsten: Btw. I think the headings "orgmode to XXX" and "XXX to orgmode" must be exchanged! -------------------------snip------------------------ #!/usr/bin/python # coding=utf-8 # remind2org.py converts the simple calendar output from remind # in files suitable for orgmode. # Two arguments are expected: # - first argument: filename for remind input file # - second argument: filename for orgmode output file # Version: 0.1 # Notice: You must include the outputfile in your org-agenda-files # # Copyright (c) 2008 # Dr. Detlef Steuer # 12.1.2008 import os, sys def processremindline(zeile): fields = zeile.split(' ') fieldnumber = len(fields) if fieldnumber < 2: return scheduled = fields[0].replace('/','-') if fields[4] != '*': scheduled = ' '.join([scheduled, fields[5]]) outline = '**' for number in range(5, fieldnumber): outline = ' '.join([outline , fields[number]]) outline = ''.join([outline,' <', scheduled, '>']) return outline if __name__ == '__main__': if len(sys.argv) != 3 : print 'Usage: remind2org remindfile orgfile' sys.exit() remindersfilename = sys.argv[1] orgfilename = sys.argv[2] remind = '/usr/bin/remind' remindcmd = ' '.join([remind, '-b1 -ss -C13']) entries = os.popen(' '.join([remindcmd,remindersfilename])).readlines() entrynumber = len(entries) orgfile = open(orgfilename,'w') print >> orgfile, '* Termine aus remind2org' print >> orgfile, '#+CATEGORY: REMIND' for i in range(entrynumber): print >> orgfile , processremindline(entries[i]) orgfile.close() -----------------------------snip-------------------------- -- Wisely, and slow. They stumble that run fast. - Shakespeare