Compare commits
No commits in common. "portable" and "main" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.history.mash
|
|
7
main.py
7
main.py
|
@ -11,13 +11,12 @@ from os.path import expanduser
|
||||||
|
|
||||||
# Some initial variables
|
# Some initial variables
|
||||||
user = os.getlogin()
|
user = os.getlogin()
|
||||||
mashLocation = os.getcwd() + "/"
|
|
||||||
initDirectory = expanduser("~")
|
initDirectory = expanduser("~")
|
||||||
argList = ["", ""]
|
argList = ["", ""]
|
||||||
|
|
||||||
# Start work on checking whether a config file exists
|
# Start work on checking whether a config file exists
|
||||||
if os.path.isfile(expanduser("~") + "/.config/mash/mash.conf") == False:
|
if os.path.isfile(expanduser("~") + "/.config/mash/mash.conf") == False:
|
||||||
configFilePath = mashLocation + "mash.conf"
|
configFilePath = "/etc/mash/mash.conf"
|
||||||
else:
|
else:
|
||||||
configFilePath = (expanduser("~") + "/.config/mash/mash.conf")
|
configFilePath = (expanduser("~") + "/.config/mash/mash.conf")
|
||||||
# Parse config file, adding variables
|
# Parse config file, adding variables
|
||||||
|
@ -86,7 +85,7 @@ for word in confArgList:
|
||||||
elif word == 'lblue':
|
elif word == 'lblue':
|
||||||
colourCodes.append('\033[14m')
|
colourCodes.append('\033[14m')
|
||||||
# Write the time to the history file
|
# Write the time to the history file
|
||||||
historyFile = open((mashLocation + "/.history.mash"), "a")
|
historyFile = open((expanduser("~") + "/.history.mash"), "a")
|
||||||
historyFile.write("\n")
|
historyFile.write("\n")
|
||||||
historyFile.write(("Session on " + str(datetime.now())))
|
historyFile.write(("Session on " + str(datetime.now())))
|
||||||
historyFile.write("\n")
|
historyFile.write("\n")
|
||||||
|
@ -190,7 +189,7 @@ def mainLoop(startDir):
|
||||||
print("Command", command, "either doesn't exist, isn't in the path or isn't in this directory.")
|
print("Command", command, "either doesn't exist, isn't in the path or isn't in this directory.")
|
||||||
|
|
||||||
# Write to the history file
|
# Write to the history file
|
||||||
historyFile = open((mashLocation + "/.history.mash"), "a")
|
historyFile = open((expanduser("~") + "/.history.mash"), "a")
|
||||||
historyFile.write(command)
|
historyFile.write(command)
|
||||||
historyFile.write("\n")
|
historyFile.write("\n")
|
||||||
historyFile.close()
|
historyFile.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user