Example #1
0
    def delete_image_from_folder(cls, file_name):

        # os_path = os.path.dirname(os.path.abspath(__file__))
        # photo_directory = path(os_path + '/static/img/photos/')

        # Use only on local machine -- must be changed on hosted version
        photo_directory = path(
            '/home/vagrant/src/projects/paleta/static/img/photos/')

        matches = photo_directory.files(file_name)

        for match in matches:
            print 'Match:', match
            path.remove(match)

        print "Deleted %s from folder" % (file_name)
Example #2
0
 def tidyUp(self):
     path.remove(self.repo_filename)
     path.rmdir(self.tmp_dir)
     #self.bf.close() # close() hangs at present
     self.rp.close()
 def tidyUp(self):
     path.remove(self.repo_filename)
     path.rmdir(self.tmp_dir)
Example #4
0
 def tidyUp(self):
     path.remove(self.repo_filename)
     path.rmdir(self.tmp_dir)
Example #5
0
 def tidyUp(self):
     path.remove(self.repo_filename)
     path.rmdir(self.tmp_dir)
     #self.bf.close() # close() hangs at present
     self.rp.close()