{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/packman/pulls/comments/57971111","id":57971111,"diff_hunk":"@@ -169,45 +169,41 @@ function makePythonPackage(opts, done) {\n     console.log('setting up python package in: %s', opts.top);\n     var finished = false;\n     var nsPackages = [];\n-    var finder = new FindFiles({\n-      rootFolder : opts.top,\n-      filterFunction : function (_unused, stat) {\n-        return stat.isDirectory();\n-      }\n-    });\n-    finder.on(\"complete\", function() {\n-      if (!finished) {\n-        next(null);\n-        finished = true;\n-        opts.packageInfo.api.nsPackages = nsPackages;\n-      }\n-    });\n-    finder.on(\"match\", function(pkgDir) {\n-      var knownNamespaces = config.pythonPkg(opts).namespaces;\n-      var src = path.join(opts.templateDir, '__init__.py');\n-      var basename = path.basename(pkgDir);\n-      var pkgName = pkgDir.replace(opts.top, '').replace(/^\\//, '');\n-      pkgName = pkgName.replace(/\\//g, '.');\n-      if (opts.buildCommonProtos && _.contains(knownNamespaces, pkgName)) {\n-        src = path.join(opts.templateDir, 'namespace__init__.py');\n-        nsPackages.push(pkgName);\n-      }\n-      if (!opts.buildCommonProtos && basename !== opts.packageInfo.api.version) {\n-        src = path.join(opts.templateDir, 'namespace__init__.py');\n-        nsPackages.push(pkgName);\n-      }\n-      var dst = path.join(pkgDir, '__init__.py');\n-      fs.copySync(src, dst);\n-    });\n-    finder.on(\"error\", function(err) {\n-      if (!finished) {\n-        console.error('failure in addPackageFiles %s', err);\n+    var knownNamespaces = config.pythonPkg(opts).namespaces;\n+\n+    var addPkgs = function addPkgs(err, pkgDirs) {","path":"lib/packager.js","position":null,"original_position":67,"commit_id":"11977cfd18dcb0253892b462777b59389879c448","original_commit_id":"8d3ef7b098b97b4d69d3816f3fbb76153ab088be","user":{"login":"tbetbetbe","id":9272342,"avatar_url":"https://avatars.githubusercontent.com/u/9272342?v=3","gravatar_id":"","url":"https://api.github.com/users/tbetbetbe","html_url":"https://github.com/tbetbetbe","followers_url":"https://api.github.com/users/tbetbetbe/followers","following_url":"https://api.github.com/users/tbetbetbe/following{/other_user}","gists_url":"https://api.github.com/users/tbetbetbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tbetbetbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbetbetbe/subscriptions","organizations_url":"https://api.github.com/users/tbetbetbe/orgs","repos_url":"https://api.github.com/users/tbetbetbe/repos","events_url":"https://api.github.com/users/tbetbetbe/events{/privacy}","received_events_url":"https://api.github.com/users/tbetbetbe/received_events","type":"User","site_admin":false},"body":"Fixed, a bit of restructuring was required","created_at":"2016-03-30T21:57:28Z","updated_at":"2016-03-30T21:57:28Z","html_url":"https://github.com/googleapis/packman/pull/13#discussion_r57971111","pull_request_url":"https://api.github.com/repos/googleapis/packman/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/googleapis/packman/pulls/comments/57971111"},"html":{"href":"https://github.com/googleapis/packman/pull/13#discussion_r57971111"},"pull_request":{"href":"https://api.github.com/repos/googleapis/packman/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/googleapis/packman/pulls/13","id":63806673,"html_url":"https://github.com/googleapis/packman/pull/13","diff_url":"https://github.com/googleapis/packman/pull/13.diff","patch_url":"https://github.com/googleapis/packman/pull/13.patch","issue_url":"https://api.github.com/repos/googleapis/packman/issues/13","number":13,"state":"open","locked":false,"title":"Replace node-find-files with glob","user":{"login":"tbetbetbe","id":9272342,"avatar_url":"https://avatars.githubusercontent.com/u/9272342?v=3","gravatar_id":"","url":"https://api.github.com/users/tbetbetbe","html_url":"https://github.com/tbetbetbe","followers_url":"https://api.github.com/users/tbetbetbe/followers","following_url":"https://api.github.com/users/tbetbetbe/following{/other_user}","gists_url":"https://api.github.com/users/tbetbetbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tbetbetbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbetbetbe/subscriptions","organizations_url":"https://api.github.com/users/tbetbetbe/orgs","repos_url":"https://api.github.com/users/tbetbetbe/repos","events_url":"https://api.github.com/users/tbetbetbe/events{/privacy}","received_events_url":"https://api.github.com/users/tbetbetbe/received_events","type":"User","site_admin":false},"body":"- glob is much more widely used\r\n\r\n- node-find-files seemed to have a race that caused the node test to\r\n  fail consistently\r\n\r\nAlso:\r\n- removed the skip on the node files\r\n\r\nChange-Id: I081177f792ab858bb46349997fa95e1da427a66f","created_at":"2016-03-22T22:56:04Z","updated_at":"2016-03-30T21:57:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3767e6073f542e99b378bc23c26a433db4a8b0b6","assignee":{"login":"jmuk","id":816093,"avatar_url":"https://avatars.githubusercontent.com/u/816093?v=3","gravatar_id":"","url":"https://api.github.com/users/jmuk","html_url":"https://github.com/jmuk","followers_url":"https://api.github.com/users/jmuk/followers","following_url":"https://api.github.com/users/jmuk/following{/other_user}","gists_url":"https://api.github.com/users/jmuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jmuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmuk/subscriptions","organizations_url":"https://api.github.com/users/jmuk/orgs","repos_url":"https://api.github.com/users/jmuk/repos","events_url":"https://api.github.com/users/jmuk/events{/privacy}","received_events_url":"https://api.github.com/users/jmuk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/packman/pulls/13/commits","review_comments_url":"https://api.github.com/repos/googleapis/packman/pulls/13/comments","review_comment_url":"https://api.github.com/repos/googleapis/packman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/packman/issues/13/comments","statuses_url":"https://api.github.com/repos/googleapis/packman/statuses/11977cfd18dcb0253892b462777b59389879c448","head":{"label":"tbetbetbe:replace-find-files-with-glob","ref":"replace-find-files-with-glob","sha":"11977cfd18dcb0253892b462777b59389879c448","user":{"login":"tbetbetbe","id":9272342,"avatar_url":"https://avatars.githubusercontent.com/u/9272342?v=3","gravatar_id":"","url":"https://api.github.com/users/tbetbetbe","html_url":"https://github.com/tbetbetbe","followers_url":"https://api.github.com/users/tbetbetbe/followers","following_url":"https://api.github.com/users/tbetbetbe/following{/other_user}","gists_url":"https://api.github.com/users/tbetbetbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tbetbetbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbetbetbe/subscriptions","organizations_url":"https://api.github.com/users/tbetbetbe/orgs","repos_url":"https://api.github.com/users/tbetbetbe/repos","events_url":"https://api.github.com/users/tbetbetbe/events{/privacy}","received_events_url":"https://api.github.com/users/tbetbetbe/received_events","type":"User","site_admin":false},"repo":{"id":53887471,"name":"packman","full_name":"tbetbetbe/packman","owner":{"login":"tbetbetbe","id":9272342,"avatar_url":"https://avatars.githubusercontent.com/u/9272342?v=3","gravatar_id":"","url":"https://api.github.com/users/tbetbetbe","html_url":"https://github.com/tbetbetbe","followers_url":"https://api.github.com/users/tbetbetbe/followers","following_url":"https://api.github.com/users/tbetbetbe/following{/other_user}","gists_url":"https://api.github.com/users/tbetbetbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tbetbetbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbetbetbe/subscriptions","organizations_url":"https://api.github.com/users/tbetbetbe/orgs","repos_url":"https://api.github.com/users/tbetbetbe/repos","events_url":"https://api.github.com/users/tbetbetbe/events{/privacy}","received_events_url":"https://api.github.com/users/tbetbetbe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbetbetbe/packman","description":"","fork":true,"url":"https://api.github.com/repos/tbetbetbe/packman","forks_url":"https://api.github.com/repos/tbetbetbe/packman/forks","keys_url":"https://api.github.com/repos/tbetbetbe/packman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbetbetbe/packman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbetbetbe/packman/teams","hooks_url":"https://api.github.com/repos/tbetbetbe/packman/hooks","issue_events_url":"https://api.github.com/repos/tbetbetbe/packman/issues/events{/number}","events_url":"https://api.github.com/repos/tbetbetbe/packman/events","assignees_url":"https://api.github.com/repos/tbetbetbe/packman/assignees{/user}","branches_url":"https://api.github.com/repos/tbetbetbe/packman/branches{/branch}","tags_url":"https://api.github.com/repos/tbetbetbe/packman/tags","blobs_url":"https://api.github.com/repos/tbetbetbe/packman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbetbetbe/packman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbetbetbe/packman/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbetbetbe/packman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbetbetbe/packman/statuses/{sha}","languages_url":"https://api.github.com/repos/tbetbetbe/packman/languages","stargazers_url":"https://api.github.com/repos/tbetbetbe/packman/stargazers","contributors_url":"https://api.github.com/repos/tbetbetbe/packman/contributors","subscribers_url":"https://api.github.com/repos/tbetbetbe/packman/subscribers","subscription_url":"https://api.github.com/repos/tbetbetbe/packman/subscription","commits_url":"https://api.github.com/repos/tbetbetbe/packman/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbetbetbe/packman/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbetbetbe/packman/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbetbetbe/packman/issues/comments{/number}","contents_url":"https://api.github.com/repos/tbetbetbe/packman/contents/{+path}","compare_url":"https://api.github.com/repos/tbetbetbe/packman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbetbetbe/packman/merges","archive_url":"https://api.github.com/repos/tbetbetbe/packman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbetbetbe/packman/downloads","issues_url":"https://api.github.com/repos/tbetbetbe/packman/issues{/number}","pulls_url":"https://api.github.com/repos/tbetbetbe/packman/pulls{/number}","milestones_url":"https://api.github.com/repos/tbetbetbe/packman/milestones{/number}","notifications_url":"https://api.github.com/repos/tbetbetbe/packman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbetbetbe/packman/labels{/name}","releases_url":"https://api.github.com/repos/tbetbetbe/packman/releases{/id}","deployments_url":"https://api.github.com/repos/tbetbetbe/packman/deployments","created_at":"2016-03-14T19:58:24Z","updated_at":"2016-03-14T19:58:26Z","pushed_at":"2016-03-30T21:57:09Z","git_url":"git://github.com/tbetbetbe/packman.git","ssh_url":"git@github.com:tbetbetbe/packman.git","clone_url":"https://github.com/tbetbetbe/packman.git","svn_url":"https://github.com/tbetbetbe/packman","homepage":null,"size":287,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googleapis:master","ref":"master","sha":"f6845712fd6208ae47e4063a408f4942b79ee09c","user":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=3","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":53885683,"name":"packman","full_name":"googleapis/packman","owner":{"login":"googleapis","id":16785467,"avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=3","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googleapis/packman","description":"","fork":false,"url":"https://api.github.com/repos/googleapis/packman","forks_url":"https://api.github.com/repos/googleapis/packman/forks","keys_url":"https://api.github.com/repos/googleapis/packman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/packman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/packman/teams","hooks_url":"https://api.github.com/repos/googleapis/packman/hooks","issue_events_url":"https://api.github.com/repos/googleapis/packman/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/packman/events","assignees_url":"https://api.github.com/repos/googleapis/packman/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/packman/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/packman/tags","blobs_url":"https://api.github.com/repos/googleapis/packman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/packman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/packman/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/packman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/packman/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/packman/languages","stargazers_url":"https://api.github.com/repos/googleapis/packman/stargazers","contributors_url":"https://api.github.com/repos/googleapis/packman/contributors","subscribers_url":"https://api.github.com/repos/googleapis/packman/subscribers","subscription_url":"https://api.github.com/repos/googleapis/packman/subscription","commits_url":"https://api.github.com/repos/googleapis/packman/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/packman/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/packman/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/packman/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/packman/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/packman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/packman/merges","archive_url":"https://api.github.com/repos/googleapis/packman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/packman/downloads","issues_url":"https://api.github.com/repos/googleapis/packman/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/packman/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/packman/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/packman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/packman/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/packman/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/packman/deployments","created_at":"2016-03-14T19:30:19Z","updated_at":"2016-03-16T21:19:52Z","pushed_at":"2016-03-30T21:57:09Z","git_url":"git://github.com/googleapis/packman.git","ssh_url":"git@github.com:googleapis/packman.git","clone_url":"https://github.com/googleapis/packman.git","svn_url":"https://github.com/googleapis/packman","homepage":null,"size":259,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/packman/pulls/13"},"html":{"href":"https://github.com/googleapis/packman/pull/13"},"issue":{"href":"https://api.github.com/repos/googleapis/packman/issues/13"},"comments":{"href":"https://api.github.com/repos/googleapis/packman/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/packman/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/packman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/packman/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/packman/statuses/11977cfd18dcb0253892b462777b59389879c448"}}}}