Inline convenience functions

WIP Add check for existing file, Groundwork for vimrc creation
This commit is contained in:
Lucas Noki 2019-12-15 07:30:20 +01:00 committed by Marcel Schwarz
parent 8496ba006e
commit ef0c7de0da

View File

@ -1,4 +1,5 @@
from IModule import IModule from IModule import IModule
import os.path
class VimModule(IModule): class VimModule(IModule):
@ -23,8 +24,8 @@ class VimModule(IModule):
print("") print("")
def select_plugins(): # Select Plugins
user_input = [int(userInput) for userInput in input("Enter multiple value: ").split()] user_input = [int(userInput) for userInput in input("Select modules: ").split()]
clean_plugin_list = set(user_input) clean_plugin_list = set(user_input)
# print out selected plugins # print out selected plugins
@ -35,4 +36,15 @@ class VimModule(IModule):
except Exception: except Exception:
print("Fail") print("Fail")
select_plugins() # Create vimrc file
vimrc_exists = os.path.isfile("testfile")
if vimrc_exists:
vimrc_file = open("testfile", "a+")
vimrc_file.write("\n" + plugins[selection][1])
vimrc_file.close()
else:
vimrc_file = open("testfile", "w+")
vimrc_file.write(plugins[selection][1])
vimrc_file.close()