Exemplo n.º 1
0
 def cd(self, cmds):
     if len(cmds) == 2:
         try:
             self.executions.change_directory(cmds[1])
         except:
             print(error.get(cmds, 'error'))
     else:
         print(help.helping(cmds))
Exemplo n.º 2
0
 def hlp(self, cmds):
     if len(cmds) == 1:
         print(help.help())
     elif len(cmds) == 2:
         print(help.helping([cmds[1]]))
     else:
         print(error.get(cmds, 'warning'))
         print(help.helping(cmds))
Exemplo n.º 3
0
 def mk(self, cmds):
     if len(cmds) == 2:
         if "." not in cmds[1]:
             self.executions.make_directory(cmds[1])
         else:
             print(error.get(cmds, 'file_error'))
     else:
         print(help.helping(cmds))
Exemplo n.º 4
0
    def add(self, cmds, unmuted=None):
        if len(cmds) < 2 or len(cmds) > 3:
            if not unmuted:
                print(help.helping(cmds))
            return
        if self.unionpath.filesystem_root_dir in cmds[1]:
            print(error.get(cmds, 'fs_error'))
            return

        if len(cmds) == 2:
            source = cmds[1]
            destination = None
        else:
            source = cmds[1]
            destination = cmds[2]

        if os.path.isdir(source):
            self.executions.add_directory_to_filesystem(source, destination)
        elif os.path.isfile(source):
            self.executions.add_file_to_filesystem(source, destination)
        else:
            print(error.get(cmds, 'path_error'))
            return
Exemplo n.º 5
0
 def quit(self, cmds):
     if len(cmds) == 1:
         return self.executions.terminate_program()
     else:
         print(error.get(cmds, 'error'))