diff --git a/Submission.py b/Submission.py index b813027..971491f 100644 --- a/Submission.py +++ b/Submission.py @@ -45,11 +45,29 @@ def fetchAndSave(self, i): def getExtension(self, lang): - if lang.find('JAVA') >= 0: - return '.java' - if lang.find('PYTH') >= 0: - return '.py' - if lang.find('C++') >= 0: - return '.cpp' - if lang.find('C') >= 0: - return '.c' + Ext = { + 'java': '.java', + 'python': '.py' + 'pyth': '.py', + 'python3': '.py', + 'python2': '.py', + 'c++': '.cpp', + 'cpp': '.cpp', + 'c': '.c', + "pascal": ".pas", + "ruby": ".rb", + "go": ".go", + "javascript": ".js", + "shell": ".sh", + "r":".r", + 'c#': '.cs', + 'php': '.php', + 'bash': '.bash', + 'haskell': '.hs', + 'ruby': '.rb', + 'perl': '.pl', + 'scala': '.scala', + 'text': '.txt' + } + + return Ext[lang.lower()]