1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-12-25 21:14:32 +03:00

learnxiny: python: minifixes

This commit is contained in:
Igor Chubin 2017-05-28 22:22:46 +00:00
parent 2811a79f1d
commit ca21475b38

View File

@ -46,7 +46,7 @@ class LearnXYAdapter(object):
else:
block.append(before)
answer.append((block_name, block))
answer.append((block_name, self._cut_block(block)))
return answer
def is_valid(self, name):
@ -122,7 +122,12 @@ class LearnPythonAdapter(LearnXYAdapter):
@staticmethod
def _cut_block(block):
return block[:-2]
answer = block[2:-1]
if answer[0].split() == '':
answer = answer[1:]
if answer[-1].split() == '':
answer = answer[:1]
return answer
#
# Exported functions