Ejemplo n.º 1
0
Archivo: util.py Proyecto: jw/vonk
def update_ignorefile(ignorefile):
    """Check to see if a given file is valid, if not remove it and
    recreate it.  Returns True when newly created, false when all
    was well."""
    if not is_valid_ignorefile(ignorefile):
        rm(ignorefile, recursive=True)
        create_ignorefile(ignorefile)
Ejemplo n.º 2
0
 def testLocalMonitor(self):
     print("Starting local monitor at '{}'...".format(ROOT))
     self.lm.start()
     print("Hello there!")
     create_file(ROOT, "foo")
     create_file(ROOT, "bar")
     create_file(ROOT, "fizz")
     create_file(ROOT, "fuzz")
     touch_file(ROOT, "bar", "This is a file called bar.\n")
     touch_file(ROOT, "bar", "This is a file called bar.\n")
     folder = join(ROOT, "one")
     makedirs(folder)
     another_folder = join(ROOT, "two")
     makedirs(another_folder)
     rm(folder)
     sleep(1)
     create_file(another_folder, "klm.txt", "Hello there!")
     create_file(another_folder, "xyz.txt", "I'm created automagically :)")
     touch_file(another_folder, "xyz.txt", "Some extra text")
     sleep(1)
     self.lm.stop()
Ejemplo n.º 3
0
 def _recreate_path(self, path):
     if exists(path):
         rm(path, recursive=True)
     mkdirs(path, parents=True)
Ejemplo n.º 4
0
Archivo: util_test.py Proyecto: jw/vonk
 def tearDownClass(cls):
     rm(LOCAL_ROOT_PATH, recursive=True)