jeffersonmourak / pyTerm

A terminal client for linux. powered with python.
MIT License
17 stars 3 forks source link

Fix pathNavigator and a few mark-down issues #9

Closed usmanayubsh closed 8 years ago

usmanayubsh commented 8 years ago

1. Without using os module's chdir, it does set the path in the prompt but does not actually change the directory. So, if pwd is executed after cd .., it prints out the child directory instead of the current directory. 2. cd ~ also leads to /home/$USER/now. 3. Navigate into the sub-directories of the current directory: It uses os.path module to check if the new path (as generated after appending the sequence to the previous path) leads to a valid directory. If it does lead to a valid sub-directory, the path is set, else, an error message Invalid Directory! is printed.

4. Stop going back to the previous directory before we end up in a no-man's land: If I keep on going back to the previous directory by running cd .. again and again, I end up in a directory where currentPath is equal to [''], running ls here produces following error:

Traceback (most recent call last): File "terminal.py", line 33, in <module> runCommand(shell.listener()) File "terminal.py", line 29, in runCommand runCommand(shell.listener()) File "terminal.py", line 29, in runCommand runCommand(shell.listener()) File "terminal.py", line 29, in runCommand runCommand(shell.listener()) File "terminal.py", line 29, in runCommand runCommand(shell.listener()) File "terminal.py", line 28, in runCommand if commands.run(commandString,configs): File ".../pyTerm/CommandsList.py", line 101, in run self.callPlugin(commandString,config) File ".../pyTerm/CommandsList.py", line 20, in callPlugin command(pyTerm=config,sequence=sequence) File ".../pyTerm/plugins/listDirectory.py", line 11, in ls dirs = os.listdir(currentPath) OSError: [Errno 2] No such file or directory: ''

One possible solution, might be, to set the path to / when currentPath[0] becomes equal to ''.

5. Fix markdown and project description in setup.py.