ports/155061: [Patch] net/googlecl - fix output of calendar list

Herbert J. Skuhra h.skuhra at gmail.com
Sat Feb 26 15:20:06 UTC 2011


>Number:         155061
>Category:       ports
>Synopsis:       [Patch] net/googlecl - fix output of calendar list
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 26 15:20:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Herbert J. Skuhra
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
>Environment:
FreeBSD oslo.ath.cx 8.2-STABLE FreeBSD 8.2-STABLE #5 r219047: Sat Feb 26 13:13:03 CET 2011     herbert at oslo.ath.cx:/usr/obj/usr/src/sys/PC1  i386
>Description:
When you run 'googlecl calendar list' instead of dates "None" is displayed; eg:

Whatever,None

instead of

Whatever,Apr 01 20:00 - Apr 01 22:00

This has been fixed in subversion (revision 541):

svn diff -r 540:541 http://googlecl.googlecode.com/svn/trunk/

Bug report:

http://code.google.com/p/googlecl/issues/detail?id=358

Attached is the patch for net/googelcl.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN net/googlecl.bak/Makefile net/googlecl/Makefile
--- net/googlecl.bak/Makefile	2011-02-17 09:30:54.000000000 +0100
+++ net/googlecl/Makefile	2011-02-17 09:35:33.000000000 +0100
@@ -7,6 +7,7 @@
 
 PORTNAME=	googlecl
 PORTVERSION=	0.9.12
+PORTREVISON=	1
 CATEGORIES=	net www python
 MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 
diff -ruN net/googlecl.bak/files/patch-__init__.py net/googlecl/files/patch-__init__.py
--- net/googlecl.bak/files/patch-__init__.py	1970-01-01 01:00:00.000000000 +0100
+++ net/googlecl/files/patch-__init__.py	2011-02-17 10:16:05.000000000 +0100
@@ -0,0 +1,40 @@
+--- src/googlecl/calendar/__init__.py.bak	2011-02-17 10:11:57.000000000 +0100
++++ src/googlecl/calendar/__init__.py	2011-02-17 10:14:06.000000000 +0100
+@@ -235,12 +235,22 @@
+ 
+ 
+ class CalendarEntryToStringWrapper(googlecl.base.BaseEntryToStringWrapper):
++  def __init__(self, entry, config):
++    """Initialize a CalendarEntry wrapper.
++
++    Args:
++      entry: CalendarEntry to interpret to strings.
++      config: Configuration parser. Needed for some values.
++    """
++    googlecl.base.BaseEntryToStringWrapper.__init__(self, entry)
++    self.config_parser = config
++
+   @property
+   def when(self):
+     """When event takes place."""
+     start_date, end_date, freq = get_datetimes(self.entry)
+-    print_format = googlecl.CONFIG.lazy_get(SECTION_HEADER,
+-                                            'date_print_format')
++    print_format = self.config_parser.lazy_get(SECTION_HEADER,
++                                                      'date_print_format')
+     start_text = time.strftime(print_format, start_date)
+     end_text = time.strftime(print_format, end_date)
+     value = start_text + ' - ' + end_text
+@@ -277,9 +287,9 @@
+ 
+     for entry in single_events:
+       print googlecl.base.compile_entry_string(
+-                                            CalendarEntryToStringWrapper(entry),
+-                                            options.fields.split(','),
+-                                            delimiter=options.delimiter)
++                            CalendarEntryToStringWrapper(entry, client.config),
++                            options.fields.split(','),
++                            delimiter=options.delimiter)
+ 
+ 
+ #===============================================================================
diff -ruN net/googlecl.bak/files/patch-base.py net/googlecl/files/patch-base.py
--- net/googlecl.bak/files/patch-base.py	1970-01-01 01:00:00.000000000 +0100
+++ net/googlecl/files/patch-base.py	2011-02-17 10:27:52.000000000 +0100
@@ -0,0 +1,17 @@
+--- src/googlecl/base.py.bak	2011-02-17 10:23:53.000000000 +0100
++++ src/googlecl/base.py	2011-02-17 10:24:55.000000000 +0100
+@@ -671,12 +671,13 @@
+       # with the missing field value.
+       val = getattr(wrapped_entry, attr.replace('-','_')) or missing_field_value
+     except ValueError, err:
+-      LOG.debug(err.args[0] + ' (Did not add value for field ' + attr + ')')
++      LOG.debug(err.args[0] + ' (value for field ' + attr + ')')
+     except AttributeError, err:
+       try:
+         # Last ditch effort to blindly grab the attribute
+         val = getattr(wrapped_entry.entry, attr).text or missing_field_value
+       except AttributeError:
++        LOG.debug(err.args[0] + ' (value for field ' + attr + ')')
+         val = missing_field_value
+     # Apparently, atom(?) doesn't always return a Unicode type when there are
+     # non-latin characters, so force everything to Unicode.


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list