Beispiel #1
0
 def test_variables_are_added(self):
     vars = {}
     vars["title"] = "Test Title"
     vars["created"] = datetime.now()
     vars["updated"] = datetime.now() + timedelta(hours=1)
     content = "{%hyde\n"
     for key, value in vars.iteritems():
         content += "    %s: %s\n" % (key, value)
     content +=  "%}"
     out = File(self.site.content_folder.child("test_yaml.html"))
     self.site.monitor(self.queue)
     t = Thread(target=self.yaml_checker, 
                     kwargs={"path":out.path, "vars":vars})
     t.start()
     out.write(content)
     t.join()
     assert self.exception_queue.empty()
     # Ensure default values are added for all pages
     #
     temp = File(self.site.content_folder.child("test.html"))
     temp.write('text')
     page = Page(temp, self.site.content_node)
     assert not page.title
     assert page.created == datetime.strptime("2000-01-01", "%Y-%m-%d")
     assert page.updated == page.created
     temp.delete()
     out.delete()
Beispiel #2
0
 def doget(self, site):
     path = self.get_argument("path", None)
     if not path:
         return
     f = File(self.siteinfo.folder.child(path))
     if not f.exists:
         return
     self.write(f.read_all())
Beispiel #3
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        if not path: return
        content = self.get_argument("content", None)
        f = File(self.siteinfo.folder.child(path))
        f.write(content)

        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        dvcs.save_draft()
Beispiel #4
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        if not path: return
        content = self.get_argument("content", None)
        f = File(self.siteinfo.folder.child(path))
        f.write(content)

        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        dvcs.save_draft()
Beispiel #5
0
 def __init__(self, a_file, node):
     super(SiteResource, self).__init__()
     self.node = node
     self.file = a_file
     self.source_file = self.file
     self.prerendered = False
     if self.node.target_folder:
         self.target_file = File(
             self.node.target_folder.child(self.file.name))
         self.temp_file = File(self.node.temp_folder.child(self.file.name))
     self.last_known_modification_time = a_file.last_modified
Beispiel #6
0
 def test_add(self, direct=False):
     self.site.monitor(self.queue)
     path = self.site.layout_folder.child("test.ggg")
     t = Thread(target=self.change_checker, 
                 kwargs={"change":"Added", "path":path})
     t.start()      
     f = File(path)        
     f.write("test")
     t.join()
     if not direct:
         f.delete()
     assert self.exception_queue.empty() 
Beispiel #7
0
 def test_delete(self):
     f = File(self.site.content_folder.child("test.ddd"))
     f.write("test")        
     self.site.refresh() 
     self.clean_queue() 
     self.site.monitor(self.queue)
     t = Thread(target=self.change_checker, 
                 kwargs={"change":"Deleted", "path":f.path})
     t.start()      
     f.delete()
     t.join()
     assert self.exception_queue.empty()
Beispiel #8
0
    def assert_valid_html(self, actual_html_resource):
        expected_text = File(TEST_ROOT.child("test_dest.html")).read_all()
        self.generator.process(actual_html_resource)

        # Ensure source file is not changed
        # The source should be copied to tmp and then
        # the processor should do its thing.
        original_source = File(TEST_ROOT.child("test_src.html")).read_all()
        source_text = actual_html_resource.file.read_all()
        assert original_source == source_text
        actual_text = actual_html_resource.temp_file.read_all()
        self.assert_html_equals(expected_text, actual_text)
Beispiel #9
0
 def test_process_page_rendering(self):
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.html"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker, 
                     kwargs={"asserter":self.assert_valid_html})
     t.start()
     source.copy_to(self.site.content_folder.child("test.html"))
     t.join()
     assert self.exception_queue.empty()
Beispiel #10
0
 def test_process_page_rendering(self):
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.html"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker,
                     kwargs={"asserter":self.assert_valid_html})
     t.start()
     source.copy_to(self.site.content_folder.child("test_render.html"))
     t.join()
     assert self.exception_queue.empty()
Beispiel #11
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        type = self.get_argument('type', None)
        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        f = None
        if type == "file":
            f = File(self.siteinfo.folder.child(path))
        else:
            f = Folder(self.siteinfo.folder.child(path))

        f.delete()
        dvcs.save_draft()
        self.init_site(site, force=True)
Beispiel #12
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        type = self.get_argument('type', None)
        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        f = None
        if type == "file":
            f = File(self.siteinfo.folder.child(path))
        else:
            f = Folder(self.siteinfo.folder.child(path))

        f.delete()
        dvcs.save_draft()
        self.init_site(site, force=True)
Beispiel #13
0
 def test_recent_posts(self):
     site = SiteInfo(settings, TEST_SITE.path)
     site.refresh()
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     self.generator.pre_process(site)
     actual_resource = site.find_resource(
         File(site.content_folder.child('recent_posts.html')))
     self.generator.process(actual_resource)
     expected_text = File(
         TEST_ROOT.child("recent_posts_dest.html")).read_all()
     actual_text = actual_resource.temp_file.read_all()
     if ORIGINAL_PRE_PROCESSORS:
         settings.SITE_PRE_PROCESSORS = ORIGINAL_PRE_PROCESSORS
     assert_html_equals(expected_text, actual_text)
Beispiel #14
0
 def test_delete_dir(self):
     d = self.site.content_folder.child_folder("test_test")
     f = File(d.child("test.nnn"))
     d.make()
     f.write("test")
     self.site.refresh()
     self.clean_queue()
     self.site.monitor(self.queue)
     t = Thread(target=self.node_remove_checker,
                 kwargs={"change":"NodeRemoved", "path":d.path})
     t.start()
     d.delete()
     t.join()
     d.delete()
     assert self.exception_queue.empty()
Beispiel #15
0
 def test_delete_dir(self):
     d = self.site.content_folder.child_folder("test_test")
     f = File(d.child("test.nnn"))
     d.make()
     f.write("test")
     self.site.refresh() 
     self.clean_queue()
     self.site.monitor(self.queue)
     t = Thread(target=self.node_remove_checker, 
                 kwargs={"change":"NodeRemoved", "path":d.path})
     t.start()      
     d.delete()
     t.join()
     d.delete()
     assert self.exception_queue.empty()
Beispiel #16
0
 def test_dates_are_converted_to_datetime(self):
     vars = {}
     vars["created"] = datetime.now().date()
     vars["updated"] = (datetime.now() + timedelta(hours=1)).date()
     content = "{%hyde\n"
     for key, value in vars.iteritems():
         content += "    %s: %s\n" % (key, value)
     content +=  "%}"
     out = File(self.site.content_folder.child("test_yaml.html"))
     out.write(content)
     page = Page(out, self.site.content_node)
     assert not page.title
     assert page.created == datetime.combine(vars["created"], time())
     assert page.updated == datetime.combine(vars["updated"], time())
     out.delete()
Beispiel #17
0
 def __init__(self):
     handlers = [
         (r"/sites", SitesJSONHandler),
         (r"/site/([^/]+)", SiteHandler),
         (r"/site/([^/]+)/files", FilesJSONHandler),
         (r"/site/([^/]+)/content", ContentHandler),
         (r"/site/([^/]+)/content/save", SaveHandler),
         (r"/site/([^/]+)/publish", PublishHandler),
         (r"/site/([^/]+)/rename", RenameHandler),
         (r"/site/([^/]+)/delete", DeleteHandler),
         (r"/site/([^/]+)/generate", GenerateHandler),
     ]
     sites = yaml.load(File(options.sites).read_all())
     opts = dict(static_path=File(__file__).parent.child("clydeweb/media"),
                 sites=sites)
     tornado.web.Application.__init__(self, handlers, **opts)
Beispiel #18
0
 def assert_resource_attributes(self, resource):
     node = resource.node
     fragment = self.get_node_fragment(node)
     assert resource.name == resource.file.name
     if resource.node.type in ("content", "media"):
         assert (resource.url == url.join(node.url, resource.file.name))
         assert (resource.full_url == url.join(node.full_url,
                                               resource.file.name))
         assert resource.target_file.same_as(
             File(node.target_folder.child(resource.file.name)))
         assert resource.temp_file.same_as(
             File(node.temp_folder.child(resource.file.name)))
     else:
         assert not resource.url
         assert not resource.full_url
     if resource.node.type == "content":
         self.assert_page_attributes(resource)
Beispiel #19
0
    def test_textile(self):
        try:
            import textile 
        except ImportError: 
            textile = False
            print "Textile not found, skipping unit tests"

        if textile:            
            self.generator = Generator(TEST_SITE.path)
            self.generator.build_siteinfo()
            source = File(TEST_ROOT.child("src_test_textile.html"))
            self.site.refresh()
            self.site.monitor(self.queue)
            t = Thread(target=self.checker, 
                            kwargs={"asserter":self.assert_valid_textile})
            t.start()
            source.copy_to(self.site.content_folder.child("test.html"))
            t.join()
            assert self.exception_queue.empty()
Beispiel #20
0
 def test_process_css_with_templates(self):
     original_MP = settings.MEDIA_PROCESSORS
     original_site = settings.SITE_ROOT
     settings.MEDIA_PROCESSORS = {"*":{".css":
     ('hydeengine.media_processors.TemplateProcessor',)}}
     settings.SITE_ROOT = "www.hyde-test.bogus/"
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.css"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker,
                     kwargs={"asserter":self.assert_valid_css})
     t.start()
     source.copy_to(self.site.media_folder.child("test.css"))
     t.join()
     settings.MEDIA_PROCESSORS = original_MP
     settings.SITE_ROOT = original_site
     assert self.exception_queue.empty()
Beispiel #21
0
 def test_process_css_with_templates(self):
     original_MP = settings.MEDIA_PROCESSORS
     original_site = settings.SITE_ROOT
     settings.MEDIA_PROCESSORS = {"*":{".css":
     ('hydeengine.media_processors.TemplateProcessor',)}}
     settings.SITE_ROOT = "www.hyde-test.bogus/"
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.css"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker, 
                     kwargs={"asserter":self.assert_valid_css})
     t.start()
     source.copy_to(self.site.media_folder.child("test.css"))
     t.join()
     settings.MEDIA_PROCESSORS = original_MP
     settings.SITE_ROOT = original_site
     assert self.exception_queue.empty()
Beispiel #22
0
 def render(self, context):
     original_page = context['page']
     self.path = original_page.node.folder.child(self.path.strip('"'))
     context.push()
     context[current_referrer] = {'namespace': self.namespace}
     context['page'] = original_page.node.find_resource(File(self.path))
     render_to_string(str(self.path), context)
     var = context[current_referrer]
     context.pop()
     context[self.namespace] = var
     return ''
Beispiel #23
0
 def test_underscored_pages_are_not_rendered(self):
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.html"))
     target = File(self.site.content_folder.child("_test.html"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker,
                     kwargs={"asserter":self.assert_layout_not_rendered})
     t.start()
     source.copy_to(target)
     t.join()
     target.delete()
     assert self.exception_queue.empty()
Beispiel #24
0
 def test_render_direct(self):
     render_folder = TEST_SITE.child_folder('content/render')
     render_folder.make()
     template_folder = TEST_SITE.child_folder('layout')
     template_folder.make()
     File(TEST_ROOT.child("render_tag/template.html")).copy_to(
         template_folder.child('render.html'))
     source = File(
         TEST_ROOT.child("render_tag/source.html")).copy_to(render_folder)
     site = SiteInfo(settings, TEST_SITE.path)
     site.refresh()
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     self.generator.pre_process(site)
     actual_resource = site.find_resource(source)
     self.generator.process(actual_resource)
     expected_text = File(
         TEST_ROOT.child("render_tag/dest.html")).read_all()
     actual_text = actual_resource.temp_file.read_all()
     if ORIGINAL_PRE_PROCESSORS:
         settings.SITE_PRE_PROCESSORS = ORIGINAL_PRE_PROCESSORS
     assert_html_equals(expected_text, actual_text)
Beispiel #25
0
    def assert_prerendered(self, actual_html_resource):
        expected_text = File(TEST_ROOT.child("test_src.html")).read_all()

        self.generator.process(actual_html_resource)

        # Ensure source file is not changed
        # The source should be copied to tmp and then
        # the processor should do its thing.
        source_text = actual_html_resource.file.read_all()
        assert expected_text == source_text
        actual_text = actual_html_resource.temp_file.read_all()

        # Since the file is prerendered, there should be no change
        assert expected_text == actual_text
Beispiel #26
0
 def test_delete(self):
     f = File(self.site.content_folder.child("test.ddd"))
     f.write("test")
     self.site.refresh()
     self.clean_queue()
     self.site.monitor(self.queue)
     t = Thread(target=self.change_checker,
                 kwargs={"change":"Deleted", "path":f.path})
     t.start()
     f.delete()
     t.join()
     assert self.exception_queue.empty()
Beispiel #27
0
 def test_add(self, direct=False):
     self.site.monitor(self.queue)
     path = self.site.layout_folder.child("test.ggg")
     t = Thread(target=self.change_checker,
                 kwargs={"change":"Added", "path":path})
     t.start()
     f = File(path)
     f.write("test")
     t.join()
     if not direct:
         f.delete()
     assert self.exception_queue.empty()
Beispiel #28
0
    def test_textile(self):
        try:
            import textile
        except ImportError:
            textile = False
            print "Textile not found, skipping unit tests"

        if textile:
            self.generator = Generator(TEST_SITE.path)
            self.generator.build_siteinfo()
            source = File(TEST_ROOT.child("src_test_textile.html"))
            self.site.refresh()
            self.site.monitor(self.queue)
            t = Thread(target=self.checker,
                            kwargs={"asserter":self.assert_valid_textile})
            t.start()
            target = File(self.site.content_folder.child("test_textile.html"))
            source.copy_to(target)
            t.join()
            target.delete()
            assert self.exception_queue.empty()
Beispiel #29
0
 def test_underscored_pages_are_not_rendered(self):
     self.generator = Generator(TEST_SITE.path)
     self.generator.build_siteinfo()
     source = File(TEST_ROOT.child("test_src.html"))
     target = File(self.site.content_folder.child("_test.html"))
     self.site.refresh()
     self.site.monitor(self.queue)
     t = Thread(target=self.checker, 
                     kwargs={"asserter":self.assert_layout_not_rendered})
     t.start()
     source.copy_to(target)
     t.join()
     target.delete()
     assert self.exception_queue.empty()
Beispiel #30
0
 def test_dates_are_converted_to_datetime(self):
     vars = {}
     vars["created"] = datetime.now().date()
     vars["updated"] = (datetime.now() + timedelta(hours=1)).date()
     content = "{%hyde\n"
     for key, value in vars.iteritems():
         content += "    %s: %s\n" % (key, value)
     content +=  "%}"
     out = File(self.site.content_folder.child("test_yaml.html"))
     out.write(content)
     page = Page(out, self.site.content_node)
     assert not page.title
     assert page.created == datetime.combine(vars["created"], time())
     assert page.updated == datetime.combine(vars["updated"], time())
     out.delete()
Beispiel #31
0
    def test_markdown(self):
        try:
            import markdown
        except ImportError:
            markdown = False
            print "Markdown not found, skipping unit tests"

        if markdown:
            self.generator = Generator(TEST_SITE.path)
            self.generator.build_siteinfo()
            source = File(TEST_ROOT.child("src_test_markdown.html"))
            self.site.refresh()
            assert self.queue.empty()
            self.site.monitor(self.queue)
            t = Thread(target=self.checker,
                            kwargs={"asserter":self.assert_valid_markdown})
            t.start()
            target = File(self.site.content_folder.child("test_md.html"))
            source.copy_to(target)
            t.join()
            target.delete()
            assert self.exception_queue.empty()
Beispiel #32
0
    def test_restructuredtext(self):
        try:
            import docutils
        except ImportError:
            docutils = False
            print "Docutils not found, skipping unit tests"

        if docutils:
            self.generator = Generator(TEST_SITE.path)
            self.generator.build_siteinfo()
            source = File(TEST_ROOT.child("src_test_restructuredtext.html"))
            self.site.refresh()
            assert self.queue.empty()
            self.site.monitor(self.queue)
            t = Thread(target=self.checker,
                            kwargs={"asserter":self.assert_valid_restructuredtext})
            t.start()
            target = File(self.site.content_folder.child("test.html"))
            source.copy_to(target)
            t.join()
            target.delete()
            assert self.exception_queue.empty()
Beispiel #33
0
    def test_filters(self):
        site = SiteInfo(settings, TEST_SITE.path)
        for name in [".banjo", ".hidden", "junk.abc~"]:
            f = File(site.content_folder.child(name))
            self.files.append(f)
            f.write("junk")
        
        git = site.content_folder.child_folder(".git")
        git_child = git.child_folder("child")
        git_child_pack = File(git_child.child("pack"))
        git.make()
        git_child.make()
        git_index = File(git.child("index"))
        git_index.write("junk")
        git_child_pack.write("junk")
            
        original_exclude = settings.FILTER['exclude']
        original_include = settings.FILTER['include']
        settings.FILTER = {}
        site = SiteInfo(settings, TEST_SITE.path)
        site.refresh()
        
        for f in self.files:
            assert site.find_resource(f)
            
        assert site.find_node(git)
        assert site.find_resource(git_index)
        assert site.find_node(git_child)
        assert site.find_resource(git_child_pack)

        settings.FILTER = { 
            'include': (),
            'exclude': (".*","*~")
        }
        
        site = SiteInfo(settings, TEST_SITE.path)        
        site.refresh()
        
        for f in self.files:
            assert not site.find_resource(f)
            
        assert not site.find_node(git)
        assert not site.find_resource(git_index)  
        assert not site.find_node(git_child)
        assert not site.find_resource(git_child_pack)  
            
        settings.FILTER = { 
            'include': (".banjo",),
            'exclude': (".*","*~")
        }

        site = SiteInfo(settings, TEST_SITE.path)        
        site.refresh()

        for f in self.files:
            if f.name == ".banjo":
                assert site.find_resource(f)
            else:
                assert not site.find_resource(f)    
                
        assert not site.find_node(git)
        assert not site.find_resource(git_index)        
            
        settings.FILTER['exclude']  = original_exclude
        settings.FILTER['include']  = original_include
        
        self.files.append(git)
Beispiel #34
0
 def doget(self, site):
     path = self.get_argument("path", None)
     if not path: return
     f = File(self.siteinfo.folder.child(path))
     if not f.exists: return
     self.write(f.read_all())
Beispiel #35
0
    def test_filters(self):
        site = SiteInfo(settings, TEST_SITE.path)
        for name in [".banjo", ".hidden", "junk.abc~"]:
            f = File(site.content_folder.child(name))
            self.files.append(f)
            f.write("junk")

        git = site.content_folder.child_folder(".git")
        git_child = git.child_folder("child")
        git_child_pack = File(git_child.child("pack"))
        git.make()
        git_child.make()
        git_index = File(git.child("index"))
        git_index.write("junk")
        git_child_pack.write("junk")

        original_exclude = settings.FILTER['exclude']
        original_include = settings.FILTER['include']
        settings.FILTER = {}
        site = SiteInfo(settings, TEST_SITE.path)
        site.refresh()

        for f in self.files:
            assert site.find_resource(f)

        assert site.find_node(git)
        assert site.find_resource(git_index)
        assert site.find_node(git_child)
        assert site.find_resource(git_child_pack)

        settings.FILTER = {
            'include': (),
            'exclude': (".*","*~")
        }

        site = SiteInfo(settings, TEST_SITE.path)
        site.refresh()

        for f in self.files:
            assert not site.find_resource(f)

        assert not site.find_node(git)
        assert not site.find_resource(git_index)
        assert not site.find_node(git_child)
        assert not site.find_resource(git_child_pack)

        settings.FILTER = {
            'include': (".banjo",),
            'exclude': (".*","*~")
        }

        site = SiteInfo(settings, TEST_SITE.path)
        site.refresh()

        for f in self.files:
            if f.name == ".banjo":
                assert site.find_resource(f)
            else:
                assert not site.find_resource(f)

        assert not site.find_node(git)
        assert not site.find_resource(git_index)

        settings.FILTER['exclude']  = original_exclude
        settings.FILTER['include']  = original_include

        self.files.append(git)
Beispiel #36
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        original_path = self.get_argument("original_path", None)
        type = self.get_argument('type', None)
        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        if type == "file":
            f = File(self.siteinfo.folder.child(original_path))
            newf = File(self.siteinfo.folder.child(path))
            if not f.exists:
                newf.write("")
                dvcs.add_file(newf)
            else:
                f.move_to(newf)
                dvcs.add_file(newf, message="Renamed " + path)

        else:
            f = Folder(self.siteinfo.folder.child(original_path))
            newf = Folder(self.siteinfo.folder.child(path))
            if not f.exists:
                newf.make()
            else:
                f.move_to(newf)
                dvcs.add_file(newf, message="Renamed " + path)
        self.init_site(site, force=True)
Beispiel #37
0
    def dopost(self, site):
        path = self.get_argument("path", None)
        original_path = self.get_argument("original_path", None)
        type = self.get_argument('type', None)
        repo = self.settings['sites'][site]['repo']
        dvcs = DVCS.load_dvcs(self.siteinfo.folder.path, repo)
        if type == "file":
            f = File(self.siteinfo.folder.child(original_path))
            newf = File(self.siteinfo.folder.child(path))
            if not f.exists:
                newf.write("")
                dvcs.add_file(newf)
            else:
                f.move_to(newf)
                dvcs.add_file(newf, message="Renamed " + path)

        else:
            f = Folder(self.siteinfo.folder.child(original_path))
            newf = Folder(self.siteinfo.folder.child(path))
            if not f.exists:
                newf.make()
            else:
                f.move_to(newf)
                dvcs.add_file(newf, message="Renamed " + path)
        self.init_site(site, force=True)
Beispiel #38
0
 def test_variables_are_added(self):
     vars = {}
     vars["title"] = "Test Title"
     vars["created"] = datetime.now()
     vars["updated"] = datetime.now() + timedelta(hours=1)
     content = "{%hyde\n"
     for key, value in vars.iteritems():
         content += "    %s: %s\n" % (key, value)
     content +=  "%}"
     out = File(self.site.content_folder.child("test_yaml.html"))
     self.site.monitor(self.queue)
     t = Thread(target=self.yaml_checker,
                     kwargs={"path":out.path, "vars":vars})
     t.start()
     out.write(content)
     t.join()
     assert self.exception_queue.empty()
     # Ensure default values are added for all pages
     #
     temp = File(self.site.content_folder.child("test_var.html"))
     temp.write('text')
     page = Page(temp, self.site.content_node)
     assert not page.title
     assert page.created == datetime.strptime("2000-01-01", "%Y-%m-%d")
     assert page.updated == page.created
     temp.delete()
     out.delete()