示例#1
0
 def compress(self, input_path):
     try:
         if os.path.abspath(input_path) == os.path.abspath(self.file_path):
             return
         gf.copytree(input_path, self.file_path)
     except Exception as exc:
         self.log_exc(u"Cannot compress unpacked", exc, True, OSError)
示例#2
0
 def compress(self, input_path):
     try:
         if os.path.abspath(input_path) == os.path.abspath(self.file_path):
             return
         gf.copytree(input_path, self.file_path)
     except Exception as exc:
         self.log_exc(u"Cannot compress unpacked", exc, True, OSError)
示例#3
0
 def test_copytree(self):
     orig = gf.tmp_directory()
     tmp_path = os.path.join(orig, "foo.bar")
     with io.open(tmp_path, "w", encoding="utf-8") as tmp_file:
         tmp_file.write(u"Foo bar")
     dest = gf.tmp_directory()
     gf.copytree(orig, dest)
     self.assertTrue(gf.file_exists(os.path.join(dest, "foo.bar")))
     gf.delete_directory(dest)
     gf.delete_directory(orig)
 def test_copytree(self):
     orig = gf.tmp_directory()
     tmp_path = os.path.join(orig, "foo.bar")
     with io.open(tmp_path, "w", encoding="utf-8") as tmp_file:
         tmp_file.write(u"Foo bar")
     dest = gf.tmp_directory()
     gf.copytree(orig, dest)
     self.assertTrue(gf.file_exists(os.path.join(dest, "foo.bar")))
     gf.delete_directory(dest)
     gf.delete_directory(orig)
示例#5
0
 def compress(self, input_path):
     if os.path.abspath(input_path) == os.path.abspath(self.file_path):
         return
     gf.copytree(input_path, self.file_path)
示例#6
0
 def decompress(self, output_path):
     if os.path.abspath(output_path) == os.path.abspath(self.file_path):
         return
     gf.copytree(self.file_path, output_path)
示例#7
0
 def compress(self, input_path):
     if os.path.abspath(input_path) == os.path.abspath(self.file_path):
         return
     gf.copytree(input_path, self.file_path)
示例#8
0
 def decompress(self, output_path):
     if os.path.abspath(output_path) == os.path.abspath(self.file_path):
         return
     gf.copytree(self.file_path, output_path)