forked from datacamp/pythonwhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedback.py
More file actions
21 lines (18 loc) · 754 Bytes
/
Copy pathFeedback.py
File metadata and controls
21 lines (18 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from protowhat.Feedback import Feedback as ProtoFeedback
class Feedback(ProtoFeedback):
def _line_info(self):
if hasattr(self.highlight, "first_token") and hasattr(
self.highlight, "last_token"
):
return {
"line_start": self.highlight.first_token.start[0],
"column_start": self.highlight.first_token.start[1],
"line_end": self.highlight.last_token.end[0],
"column_end": self.highlight.last_token.end[1],
}
def get_formatted_line_info(self):
formatted_info = self.get_line_info()
for k in ["column_start"]:
if k in formatted_info:
formatted_info[k] += 1
return formatted_info