Beispiel #1
0
def do_add(dirpath):
   '''
   Use WinEnv to add a directory to the %path%.
   '''
   if not os.path.isdir(newpath(dirpath)):
      logging.critical('Directory does not exist: ' + dirpath)
      return False

   if not self_is_elevated():
      logging.critical('You need to be elevated/admin...')
      return False

   env = WinEnv()
   env.add(KEY_PATH, dirpath)
   env.announce()
   return True
Beispiel #2
0
def do_remove(dirpath):
   '''
   Use WinEnv to remove an item from the %path%.
   '''
   env = WinEnv()
   return env.remove(KEY_PATH, dirpath)
Beispiel #3
0
def do_read_list():
   '''
   Use WinEnv to query all the dirs in the %path%.
   '''
   env = WinEnv()
   return env.read_list(KEY_PATH)