emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Introducing ical2org
@ 2010-02-13 14:52 Doug Hellmann
  2010-02-16  4:53 ` Carsten Dominik
  2010-03-06 23:49 ` KANEUCHI Tetsuya
  0 siblings, 2 replies; 3+ messages in thread
From: Doug Hellmann @ 2010-02-13 14:52 UTC (permalink / raw)
  To: Emacs Org-mode

ical2org is a command line tool for exporting data from the Mac OS X  
application iCal so it can be used with org-mode.  Data transfer is  
one-way only (from iCal to emacs), and is intended to be used to show  
alarms and scheduled events managed by iCal within org's agenda view.   
Any calendar accessible to iCal can be converted; I use it with group  
calendar subscriptions, Google calendar feeds, and private local  
calendars.

Version 1.0.2 produces output using org-mode outline (in which each  
entry includes the summary, location, date and time, and complete  
event description) or an abbreviated format compatible with diary mode.

The program is a stand-alone Python app, available under a BSD  
license.  Installation and usage instructions are available from http://www.doughellmann.com/projects/ical2org/ 
.

Doug

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Introducing ical2org
  2010-02-13 14:52 Introducing ical2org Doug Hellmann
@ 2010-02-16  4:53 ` Carsten Dominik
  2010-03-06 23:49 ` KANEUCHI Tetsuya
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-02-16  4:53 UTC (permalink / raw)
  To: Doug Hellmann; +Cc: Emacs Org-mode

Hi Doug, this is very interesting, thank you very much.

- Carsten

On Feb 13, 2010, at 3:52 PM, Doug Hellmann wrote:

> ical2org is a command line tool for exporting data from the Mac OS X  
> application iCal so it can be used with org-mode.  Data transfer is  
> one-way only (from iCal to emacs), and is intended to be used to  
> show alarms and scheduled events managed by iCal within org's agenda  
> view.  Any calendar accessible to iCal can be converted; I use it  
> with group calendar subscriptions, Google calendar feeds, and  
> private local calendars.
>
> Version 1.0.2 produces output using org-mode outline (in which each  
> entry includes the summary, location, date and time, and complete  
> event description) or an abbreviated format compatible with diary  
> mode.
>
> The program is a stand-alone Python app, available under a BSD  
> license.  Installation and usage instructions are available from http://www.doughellmann.com/projects/ical2org/ 
> .
>
> Doug
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Introducing ical2org
  2010-02-13 14:52 Introducing ical2org Doug Hellmann
  2010-02-16  4:53 ` Carsten Dominik
@ 2010-03-06 23:49 ` KANEUCHI Tetsuya
  1 sibling, 0 replies; 3+ messages in thread
From: KANEUCHI Tetsuya @ 2010-03-06 23:49 UTC (permalink / raw)
  To: Doug Hellmann; +Cc: Emacs Org-mode

Hi Doug,

On Sat, Feb 13, 2010 at 11:52 PM, Doug Hellmann <doug.hellmann@gmail.com> wrote:
> ical2org is a command line tool for exporting data from the Mac OS X
> application iCal so it can be used with org-mode.

Thank you very much for the very nice tool.

I've tried ical2org by installing with MacPorts' pip for Python 2.6
and found 2 problems.
And I made a patch for avoiding them for me.

1) Running without -o option, UnicodeEncodeError with non-ascii
events. Here is the traceback output.

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ical2org",
line 8, in <module>
    load_entry_point('ical2org==1.0.2', 'console_scripts', 'ical2org')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ical2org/app.py",
line 183, in main
    formatter.add_event(event)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ical2org/format.py",
line 54, in add_event
    self.output.write(self.format_event(event))
UnicodeEncodeError: 'ascii' codec can't encode characters in position
3-32: ordinal not in range(128)

2) List index out of range error for description handling(I guess).
Here is the traceback output.

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ical2org",
line 8, in <module>
    load_entry_point('ical2org==1.0.2', 'console_scripts', 'ical2org')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ical2org/app.py",
line 183, in main
    formatter.add_event(event)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ical2org/format.py",
line 54, in add_event
    self.output.write(self.format_event(event))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ical2org/org.py",
line 63, in format_event
    lines.append('   - %s' % desc_lines[0])
IndexError: list index out of range


====
It's a patch to avoid these problems. It works for me.

diff -u orig/app.py ./app.py
--- orig/app.py	2010-03-07 07:29:17.000000000 +0900
+++ ./app.py	2010-03-07 08:19:51.000000000 +0900
@@ -167,7 +167,7 @@

active_only=options.active_only)

     # Process the calendar data
-    output = sys.stdout
+    output = codecs.getwriter('utf-8')(sys.stdout)
     if options.output_file_name:
         output = codecs.open(options.output_file_name, 'wt', 'UTF-8')
     try:
Binary files orig/app.pyc and ./app.pyc differ
diff -u orig/org.py ./org.py
--- orig/org.py	2010-03-07 07:31:49.000000000 +0900
+++ ./org.py	2010-03-07 08:25:27.000000000 +0900
@@ -60,8 +60,9 @@
 # Unicode error for PyATL calendar events.
         if getattr(event, 'description', None):
             desc_lines = event.description.value.splitlines()
-            lines.append('   - %s' % desc_lines[0])
-            lines.extend([ '     %s' % l for l in desc_lines[1:]])
+            if len(desc_lines) > 0:
+                lines.append('   - %s' % desc_lines[0])
+                lines.extend([ '     %s' % l for l in desc_lines[1:]])

         lines.append('')
         return '\n'.join(lines)


I hope this helps.

-- 
KANEUCHI Tetsuya

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-06 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-13 14:52 Introducing ical2org Doug Hellmann
2010-02-16  4:53 ` Carsten Dominik
2010-03-06 23:49 ` KANEUCHI Tetsuya

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).