{"action":"created","comment":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/32315186","id":32315186,"diff_hunk":"@@ -655,50 +645,56 @@ define([\n                                this.fontinfoFileName, this.fontinfoFile );\n     };\n \n-    function exportInstance(io, project, masterName, dirName, precision) {\n-        // returns a models/Controller\n-        var model = project.open(masterName)\n-          , master = model.query('master#' + masterName)\n-          , glyphSet\n-          , exportController\n-          ;\n-\n-        // create a bare ufoV2 directory\n-        io.mkDir(false, dirName);\n-\n-        // create dirName/metainfo.plist\n-        io.writeFile(false, dirName+'/metainfo.plist'\n-                                , plistLib.createPlistString(metainfoV2));\n-\n-        // fontforge requires a fontinfo.plist that defines unitsPerEm\n-        io.writeFile(false, dirName+'/fontinfo.plist'\n-                                , plistLib.createPlistString(minimalFontinfo));\n+    _p.exportUFOInstance_chunk = function(masterName, dirName, precision) {\n+        if (this.chunk_io[masterName] == undefined){\n+            this.chunk_io[masterName] = new InMemory();\n+        }\n \n-        io.mkDir(false, dirName+'/glyphs');\n-        io.writeFile(false, dirName+'/glyphs/contents.plist', plistLib.createPlistString({}));\n+        if (this.chunk_exportController[masterName] == undefined){\n+            this.chunk_exportController[masterName] = new UFOExportController(this.chunk_io[masterName], this, masterName, dirName, precision);\n+        }\n \n-        glyphSet = GlyphSet.factory(false, io, dirName+'/glyphs', undefined, 2);\n+        var it = this.chunk_exportController[masterName].run_export_iteration();\n+        if (it.done){\n+            delete this.chunk_exportController[masterName];\n+        }\n+        return it;\n+    };\n \n-        exportController = new UFOExportController(master, model, glyphSet, precision);\n-        exportController.do_export();\n+    function exportUFOInstance(io, project, masterName, dirName, precision) {\n+        var exportController = new UFOExportController(io, project, masterName, dirName, precision)\n+          , done = false\n+          ;\n+        while (!done) {\n+            done = exportController.run_export_iteration().done;\n+        }\n     }\n \n     _p.exportInstance = function(masterName, targetFileName, precision){\n         if (targetFileName.slice(-8) === '.ufo.zip'){\n-            var zipped = this.getZippedInstance(masterName, targetFileName, precision, 'nodebuffer');\n+            var zipped = this.getZippedInstance(masterName, targetFileName.split(\".zip\")[0], precision, 'nodebuffer');\n             this._io.writeFile(false, targetFileName, zipped);\n         } else if (targetFileName.slice(-4) === '.otf'){\n             var otf = this.getOTFInstance(masterName, this);\n             this._io.writeFile(false, targetFileName, otf);\n         } else {\n-            exportInstance(this._io, this, masterName, targetFileName, precision);\n+            exportUFOInstance(this._io, this, masterName, targetFileName, precision);\n         }\n     };\n \n     _p.getZippedInstance = function(masterName, targetDirName, precision, dataType) {","path":"app/lib/project/MetapolatorProject.js","position":100,"original_position":100,"commit_id":"9ded0d609c5f225ee5021e424560a6ced634ccb2","original_commit_id":"9ded0d609c5f225ee5021e424560a6ced634ccb2","user":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=3","gravatar_id":"","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"body":"Keep the old implementation of this. The side-effect of `this.chunk_io[masterName]` is very confusing. Since the ui already handles zipping we will do it there. That's the price to pay for having control over the export to update the progressbar.","created_at":"2015-06-12T13:27:35Z","updated_at":"2015-06-12T13:27:35Z","html_url":"https://github.com/metapolator/metapolator/pull/610#discussion_r32315186","pull_request_url":"https://api.github.com/repos/metapolator/metapolator/pulls/610","_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/32315186"},"html":{"href":"https://github.com/metapolator/metapolator/pull/610#discussion_r32315186"},"pull_request":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/610"}}},"pull_request":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/610","id":37084061,"html_url":"https://github.com/metapolator/metapolator/pull/610","diff_url":"https://github.com/metapolator/metapolator/pull/610.diff","patch_url":"https://github.com/metapolator/metapolator/pull/610.patch","issue_url":"https://api.github.com/repos/metapolator/metapolator/issues/610","number":610,"state":"open","locked":false,"title":"Improve progressbar","user":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-06T03:32:53Z","updated_at":"2015-06-12T13:27:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dcb81797fdfa879671c3f81c9fe1d95ac99fefb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/metapolator/metapolator/pulls/610/commits","review_comments_url":"https://api.github.com/repos/metapolator/metapolator/pulls/610/comments","review_comment_url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metapolator/metapolator/issues/610/comments","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/9ded0d609c5f225ee5021e424560a6ced634ccb2","head":{"label":"felipesanches:improve_progressbar","ref":"improve_progressbar","sha":"9ded0d609c5f225ee5021e424560a6ced634ccb2","user":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"repo":{"id":33308614,"name":"metapolator","full_name":"felipesanches/metapolator","owner":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felipesanches/metapolator","description":"Design typeface families","fork":true,"url":"https://api.github.com/repos/felipesanches/metapolator","forks_url":"https://api.github.com/repos/felipesanches/metapolator/forks","keys_url":"https://api.github.com/repos/felipesanches/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felipesanches/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felipesanches/metapolator/teams","hooks_url":"https://api.github.com/repos/felipesanches/metapolator/hooks","issue_events_url":"https://api.github.com/repos/felipesanches/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/felipesanches/metapolator/events","assignees_url":"https://api.github.com/repos/felipesanches/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/felipesanches/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/felipesanches/metapolator/tags","blobs_url":"https://api.github.com/repos/felipesanches/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felipesanches/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felipesanches/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/felipesanches/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felipesanches/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/felipesanches/metapolator/languages","stargazers_url":"https://api.github.com/repos/felipesanches/metapolator/stargazers","contributors_url":"https://api.github.com/repos/felipesanches/metapolator/contributors","subscribers_url":"https://api.github.com/repos/felipesanches/metapolator/subscribers","subscription_url":"https://api.github.com/repos/felipesanches/metapolator/subscription","commits_url":"https://api.github.com/repos/felipesanches/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/felipesanches/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/felipesanches/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/felipesanches/metapolator/issues/comments{/number}","contents_url":"https://api.github.com/repos/felipesanches/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/felipesanches/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felipesanches/metapolator/merges","archive_url":"https://api.github.com/repos/felipesanches/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felipesanches/metapolator/downloads","issues_url":"https://api.github.com/repos/felipesanches/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/felipesanches/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/felipesanches/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/felipesanches/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felipesanches/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/felipesanches/metapolator/releases{/id}","created_at":"2015-04-02T12:52:37Z","updated_at":"2015-04-30T20:11:42Z","pushed_at":"2015-06-11T22:37:45Z","git_url":"git://github.com/felipesanches/metapolator.git","ssh_url":"git@github.com:felipesanches/metapolator.git","clone_url":"https://github.com/felipesanches/metapolator.git","svn_url":"https://github.com/felipesanches/metapolator","homepage":"metapolator.com","size":161175,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metapolator:master","ref":"master","sha":"176f24cc22c1df562b9feaf47fb17eb5aaa097bf","user":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=3","gravatar_id":"","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"repo":{"id":9852744,"name":"metapolator","full_name":"metapolator/metapolator","owner":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=3","gravatar_id":"","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metapolator/metapolator","description":"Design fonts and font families faster","fork":false,"url":"https://api.github.com/repos/metapolator/metapolator","forks_url":"https://api.github.com/repos/metapolator/metapolator/forks","keys_url":"https://api.github.com/repos/metapolator/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metapolator/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metapolator/metapolator/teams","hooks_url":"https://api.github.com/repos/metapolator/metapolator/hooks","issue_events_url":"https://api.github.com/repos/metapolator/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/metapolator/metapolator/events","assignees_url":"https://api.github.com/repos/metapolator/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/metapolator/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/metapolator/metapolator/tags","blobs_url":"https://api.github.com/repos/metapolator/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metapolator/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metapolator/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/metapolator/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/metapolator/metapolator/languages","stargazers_url":"https://api.github.com/repos/metapolator/metapolator/stargazers","contributors_url":"https://api.github.com/repos/metapolator/metapolator/contributors","subscribers_url":"https://api.github.com/repos/metapolator/metapolator/subscribers","subscription_url":"https://api.github.com/repos/metapolator/metapolator/subscription","commits_url":"https://api.github.com/repos/metapolator/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/metapolator/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/metapolator/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/metapolator/metapolator/issues/comments{/number}","contents_url":"https://api.github.com/repos/metapolator/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/metapolator/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metapolator/metapolator/merges","archive_url":"https://api.github.com/repos/metapolator/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metapolator/metapolator/downloads","issues_url":"https://api.github.com/repos/metapolator/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/metapolator/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/metapolator/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/metapolator/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metapolator/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/metapolator/metapolator/releases{/id}","created_at":"2013-05-04T10:51:47Z","updated_at":"2015-05-26T13:10:33Z","pushed_at":"2015-06-11T22:37:46Z","git_url":"git://github.com/metapolator/metapolator.git","ssh_url":"git@github.com:metapolator/metapolator.git","clone_url":"https://github.com/metapolator/metapolator.git","svn_url":"https://github.com/metapolator/metapolator","homepage":"http://metapolator.com","size":168199,"stargazers_count":127,"watchers_count":127,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":105,"forks":17,"open_issues":105,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/610"},"html":{"href":"https://github.com/metapolator/metapolator/pull/610"},"issue":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/610"},"comments":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/610/comments"},"review_comments":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/610/comments"},"review_comment":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/610/commits"},"statuses":{"href":"https://api.github.com/repos/metapolator/metapolator/statuses/9ded0d609c5f225ee5021e424560a6ced634ccb2"}}}}