Org-mode mailing list
 help / color / Atom feed
From: Detlef Steuer <detlef.steuer@gmx.de>
To: emacs-orgmode@gnu.org
Subject: Translator: remind2org
Date: Sat, 12 Jan 2008 17:55:02 +0100
Message-ID: <20080112175502.0fb06b66@linux.site> (raw)

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 <steuer@hsu-hh.de>
# 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

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12 16:55 Detlef Steuer [this message]
2008-01-14 20:12 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080112175502.0fb06b66@linux.site \
    --to=detlef.steuer@gmx.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

Archives are clonable:
	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git