Learn Python in Y Minutes
| 846 | |
| 847 | |
| 848 | class LearnPythonAdapter(LearnXYAdapter): |
| 849 | """ |
| 850 | Learn Python in Y Minutes |
| 851 | """ |
| 852 | |
| 853 | prefix = "python" |
| 854 | _filename = "python.html.markdown" |
| 855 | |
| 856 | def _is_block_separator(self, before, now, after): |
| 857 | if ( |
| 858 | re.match("#######+", before) |
| 859 | and re.match("#######+", after) |
| 860 | and re.match(r"#+\s+[0-9]+\.", now) |
| 861 | ): |
| 862 | block_name = re.sub(r"#+\s+[0-9]+\.\s*", "", now) |
| 863 | block_name = "_".join(block_name.strip().split()) |
| 864 | return block_name |
| 865 | return None |
| 866 | |
| 867 | @staticmethod |
| 868 | def _cut_block(block, start_block=False): |
| 869 | answer = block[2:-1] |
| 870 | if answer[0].split() == "": |
| 871 | answer = answer[1:] |
| 872 | if answer[-1].split() == "": |
| 873 | answer = answer[:1] |
| 874 | return answer |
| 875 | |
| 876 | |
| 877 | class LearnPython3Adapter(LearnXYAdapter): |
nothing calls this directly
no outgoing calls
no test coverage detected