Gentoo Archives: gentoo-commits

From: "Alex Alexander (wired)" <wired@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/googlecl/files: googlecl-0.9.12-calendar_dates.patch
Date: Wed, 23 Feb 2011 07:54:43
Message-Id: 20110223075434.1E4CC20057@flycatcher.gentoo.org
1 wired 11/02/23 07:54:34
2
3 Added: googlecl-0.9.12-calendar_dates.patch
4 Log:
5 fixed bug #355913 (date not showing in the calendar's 'when' field)
6
7 (Portage version: 2.2.0_alpha24/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-misc/googlecl/files/googlecl-0.9.12-calendar_dates.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/googlecl/files/googlecl-0.9.12-calendar_dates.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/googlecl/files/googlecl-0.9.12-calendar_dates.patch?rev=1.1&content-type=text/plain
14
15 Index: googlecl-0.9.12-calendar_dates.patch
16 ===================================================================
17 fix "when" field in calendar not showing dates
18
19 http://bugs.gentoo.org/show_bug.cgi?id=355913
20 http://code.google.com/p/googlecl/issues/detail?id=358
21
22 Index: googlecl/base.py
23 ===================================================================
24 --- src/googlecl/base.py (revision 527)
25 +++ src/googlecl/base.py (working copy)
26 @@ -673,10 +673,12 @@
27 except ValueError, err:
28 LOG.debug(err.args[0] + ' (Did not add value for field ' + attr + ')')
29 except AttributeError, err:
30 + LOG.debug(err.args[0] + ' (value for field ' + attr + ')')
31 try:
32 # Last ditch effort to blindly grab the attribute
33 val = getattr(wrapped_entry.entry, attr).text or missing_field_value
34 except AttributeError:
35 + LOG.debug(err.args[0] + ' (value for field ' + attr + ')')
36 val = missing_field_value
37 # Apparently, atom(?) doesn't always return a Unicode type when there are
38 # non-latin characters, so force everything to Unicode.
39 Index: googlecl/calendar/__init__.py
40 ===================================================================
41 --- src/googlecl/calendar/__init__.py (revision 527)
42 +++ src/googlecl/calendar/__init__.py (working copy)
43 @@ -235,12 +235,22 @@
44
45
46 class CalendarEntryToStringWrapper(googlecl.base.BaseEntryToStringWrapper):
47 + def __init__(self, entry, config):
48 + """Initialize a CalendarEntry wrapper.
49 +
50 + Args:
51 + entry: CalendarEntry to interpret to strings.
52 + config: Configuration parser. Needed for some values.
53 + """
54 + googlecl.base.BaseEntryToStringWrapper.__init__(self, entry)
55 + self.config_parser = config
56 +
57 @property
58 def when(self):
59 """When event takes place."""
60 start_date, end_date, freq = get_datetimes(self.entry)
61 - print_format = googlecl.CONFIG.lazy_get(SECTION_HEADER,
62 - 'date_print_format')
63 + print_format = self.config_parser.lazy_get(SECTION_HEADER,
64 + 'date_print_format')
65 start_text = time.strftime(print_format, start_date)
66 end_text = time.strftime(print_format, end_date)
67 value = start_text + ' - ' + end_text
68 @@ -277,9 +287,9 @@
69
70 for entry in single_events:
71 print googlecl.base.compile_entry_string(
72 - CalendarEntryToStringWrapper(entry),
73 - options.fields.split(','),
74 - delimiter=options.delimiter)
75 + CalendarEntryToStringWrapper(entry, client.config),
76 + options.fields.split(','),
77 + delimiter=options.delimiter)
78
79
80 #===============================================================================