On Tue, 08 Nov 2011 17:48:57 -0800, Gnarlodious wrote:
> On Nov 8, 3:16 pm, Steven D'Aprano wrote:
>
>> content = Data.Dict.SaveEvents(Data.Plist.Events) or content
>>
>> This will leave content unchanged if no error is returned, otherwise it
>> will replace the value.
> Ah, the 'or' operator doe
On Nov 8, 3:16 pm, Steven D'Aprano wrote:
> content = Data.Dict.SaveEvents(Data.Plist.Events) or content
>
> This will leave content unchanged if no error is returned, otherwise it
> will replace the value.
Ah, the 'or' operator does it. Thank you, that is exactly what I was
looking for.
I should
On Tue, 08 Nov 2011 05:20:51 -0800, Gnarlodious wrote:
> What I say is this:
>
> def SaveEvents(self,events):
>try:
> plistlib.writePlist(events, self.path+'/Data/Events.plist') #
> None if OK
>except IOError:
> return "IOError: [Errno 13] Apache can't write Events.plist
> fil
Jean-Michel Pichavant wrote:
Gnarlodious wrote:
What I say is this:
def SaveEvents(self,events):
try:
plistlib.writePlist(events, self.path+'/Data/Events.plist') #
None if OK
except IOError:
return "IOError: [Errno 13] Apache can't write Events.plist
file"
Note that success r
Gnarlodious wrote:
What I say is this:
def SaveEvents(self,events):
try:
plistlib.writePlist(events, self.path+'/Data/Events.plist') #
None if OK
except IOError:
return "IOError: [Errno 13] Apache can't write Events.plist
file"
Note that success returns"None" while failure ret
What I say is this:
def SaveEvents(self,events):
try:
plistlib.writePlist(events, self.path+'/Data/Events.plist') #
None if OK
except IOError:
return "IOError: [Errno 13] Apache can't write Events.plist
file"
Note that success returns"None" while failure returns a string.
I cat