Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
809d9b8b
Commit
809d9b8b
authored
May 31, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print error message when trying to output to iCalendar in Python 3.2.
parent
d941d514
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
topydo/commands/ListCommand.py
topydo/commands/ListCommand.py
+13
-6
No files found.
topydo/commands/ListCommand.py
View file @
809d9b8b
...
...
@@ -38,16 +38,18 @@ class ListCommand(ExpressionCommand):
def
_poke_icalendar
(
self
):
"""
Attempts to import the icalendar package. Returns True if it
succeeds, otherwise False
succeeds, otherwise False.
Raises a SyntaxError when icalendar couldn't be imported (most likely
under Python 3.2.
"""
try
:
import
icalendar
as
_
except
ImportError
:
self
.
error
(
"icalendar package is not installed."
)
return
False
except
SyntaxError
:
self
.
error
(
"icalendar is not supported in this Python version."
)
return
False
# may also raise SyntaxError, but we'll deal with that in execute()
return
True
...
...
@@ -103,9 +105,14 @@ class ListCommand(ExpressionCommand):
if
not
super
(
ListCommand
,
self
).
execute
():
return
False
self
.
_process_flags
()
self
.
_print
()
try
:
self
.
_process_flags
()
except
SyntaxError
:
# importing icalendar failed, most likely due to Python 3.2
self
.
error
(
"icalendar is not supported in this Python version."
)
return
False
self
.
_print
()
return
True
def
usage
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment