Esempio n. 1
0
def export(project_path, dst_path):
    p = Project(project_path, False)
    p.load()

    if p.has_error():
        raise Exception('All errors must be fixed before exporting.')

    from structer.exporter import DefaultObjectExporter
    exp = DefaultObjectExporter(p)

    from zipfile import ZipFile
    zf = None
    try:
        zf = ZipFile(dst_path, 'w')
        files = exp.export()
        for fn, data in files:
            zf.writestr(fn, data)
    finally:
        if zf:
            zf.close()
Esempio n. 2
0
def export(project_path, dst_path):
    p = Project(project_path, False)
    p.load()
    
    if p.has_error():
        raise Exception('All errors must be fixed before exporting.')
    
    from structer.exporter import DefaultObjectExporter
    exp = DefaultObjectExporter(p)
    
    from zipfile import ZipFile
    zf = None
    try:
        zf = ZipFile(dst_path, 'w')
        files = exp.export()
        for fn, data in files:
            zf.writestr(fn, data)
    finally:
        if zf:
            zf.close()
Esempio n. 3
0
 def _load_project(self, path):
     from structer.project import Project
     project = Project(path, False)
     
     project.load()
     self.update_project(project)
Esempio n. 4
0
    def _load_project(self, path):
        from structer.project import Project
        project = Project(path, False)

        project.load()
        self.update_project(project)