{"action":"opened","number":99,"pull_request":{"url":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99","id":79085363,"html_url":"https://github.com/nuxeo/nuxeo-drive/pull/99","diff_url":"https://github.com/nuxeo/nuxeo-drive/pull/99.diff","patch_url":"https://github.com/nuxeo/nuxeo-drive/pull/99.patch","issue_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/99","number":99,"state":"open","locked":false,"title":"Up/master","user":{"login":"mconstantin","id":2531099,"avatar_url":"https://avatars.githubusercontent.com/u/2531099?v=3","gravatar_id":"","url":"https://api.github.com/users/mconstantin","html_url":"https://github.com/mconstantin","followers_url":"https://api.github.com/users/mconstantin/followers","following_url":"https://api.github.com/users/mconstantin/following{/other_user}","gists_url":"https://api.github.com/users/mconstantin/gists{/gist_id}","starred_url":"https://api.github.com/users/mconstantin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconstantin/subscriptions","organizations_url":"https://api.github.com/users/mconstantin/orgs","repos_url":"https://api.github.com/users/mconstantin/repos","events_url":"https://api.github.com/users/mconstantin/events{/privacy}","received_events_url":"https://api.github.com/users/mconstantin/received_events","type":"User","site_admin":false},"body":"Refactoring breaks down the if...elif...else... in the _is_ignored_ method into separate \"filters\", making it modular.\r\nAs a result, no need to override the method in _CPOLocalClient_ to ignore something else.\r\nJust add another method **anywhere**  in the source code (example for an instance method):\r\n```Python\r\nfrom nxdrive.client.local_client import register\r\n...\r\nclass CPOLocalClient(LocalClient):\r\n    # Limit to 5GB files\r\n    SIZE_LIMIT = 5 * 1024 * 1024 * 1024\r\n\r\n    @register(max_size=SIZE_LIMIT)\r\n    def ignore_by_size(self, parent, name, **kwargs):\r\n        max_size = kwargs['max_size']\r\n        path = self._abspath(os.path.join(parent, name))\r\n        stat = os.stat(path)\r\n        return stat.st_size > max_size\r\n    ...\r\n    # other methods here\r\n```\r\nFor a module level method, just pass None for the first argument (assuming the local client is not needed, e.g. for calculating the absolute path).  \r\nUse _apply_to_parent_ decorator argument to allow a filter to apply to file's parent as well.\r\nThis way, files in an \"ignored\" folder will be ignored as well (new); this could be applied to the \"prefix\" rule (because folders starting with '.' are hidden on Mac) and to the \"hidden attribute\" rule (Windows).  \r\nNote that this will also ignore folders starting with '~$' or the word 'Icon', etc. To fix this may create another \"ignore filter\" function and apply only the '.' prefix to it (and also the _apply_to_parent=True_).\r\n","created_at":"2016-07-27T19:44:24Z","updated_at":"2016-07-27T19:44:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99/commits","review_comments_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99/comments","review_comment_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/99/comments","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/statuses/e5718222bcf59a1b430b2f88373d87c37a61fb44","head":{"label":"mconstantin:up/master","ref":"up/master","sha":"e5718222bcf59a1b430b2f88373d87c37a61fb44","user":{"login":"mconstantin","id":2531099,"avatar_url":"https://avatars.githubusercontent.com/u/2531099?v=3","gravatar_id":"","url":"https://api.github.com/users/mconstantin","html_url":"https://github.com/mconstantin","followers_url":"https://api.github.com/users/mconstantin/followers","following_url":"https://api.github.com/users/mconstantin/following{/other_user}","gists_url":"https://api.github.com/users/mconstantin/gists{/gist_id}","starred_url":"https://api.github.com/users/mconstantin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconstantin/subscriptions","organizations_url":"https://api.github.com/users/mconstantin/orgs","repos_url":"https://api.github.com/users/mconstantin/repos","events_url":"https://api.github.com/users/mconstantin/events{/privacy}","received_events_url":"https://api.github.com/users/mconstantin/received_events","type":"User","site_admin":false},"repo":{"id":47999963,"name":"nuxeo-drive","full_name":"mconstantin/nuxeo-drive","owner":{"login":"mconstantin","id":2531099,"avatar_url":"https://avatars.githubusercontent.com/u/2531099?v=3","gravatar_id":"","url":"https://api.github.com/users/mconstantin","html_url":"https://github.com/mconstantin","followers_url":"https://api.github.com/users/mconstantin/followers","following_url":"https://api.github.com/users/mconstantin/following{/other_user}","gists_url":"https://api.github.com/users/mconstantin/gists{/gist_id}","starred_url":"https://api.github.com/users/mconstantin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconstantin/subscriptions","organizations_url":"https://api.github.com/users/mconstantin/orgs","repos_url":"https://api.github.com/users/mconstantin/repos","events_url":"https://api.github.com/users/mconstantin/events{/privacy}","received_events_url":"https://api.github.com/users/mconstantin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mconstantin/nuxeo-drive","description":"","fork":true,"url":"https://api.github.com/repos/mconstantin/nuxeo-drive","forks_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/forks","keys_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/teams","hooks_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/hooks","issue_events_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/issues/events{/number}","events_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/events","assignees_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/assignees{/user}","branches_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/branches{/branch}","tags_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/tags","blobs_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/git/refs{/sha}","trees_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/statuses/{sha}","languages_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/languages","stargazers_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/stargazers","contributors_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/contributors","subscribers_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/subscribers","subscription_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/subscription","commits_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/commits{/sha}","git_commits_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/git/commits{/sha}","comments_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/comments{/number}","issue_comment_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/issues/comments{/number}","contents_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/contents/{+path}","compare_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/merges","archive_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/downloads","issues_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/issues{/number}","pulls_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/pulls{/number}","milestones_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/milestones{/number}","notifications_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/labels{/name}","releases_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/releases{/id}","deployments_url":"https://api.github.com/repos/mconstantin/nuxeo-drive/deployments","created_at":"2015-12-14T20:39:12Z","updated_at":"2016-01-12T22:20:09Z","pushed_at":"2016-07-27T19:31:09Z","git_url":"git://github.com/mconstantin/nuxeo-drive.git","ssh_url":"git@github.com:mconstantin/nuxeo-drive.git","clone_url":"https://github.com/mconstantin/nuxeo-drive.git","svn_url":"https://github.com/mconstantin/nuxeo-drive","homepage":null,"size":11974,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"nuxeo:master","ref":"master","sha":"ac738a096c90bce5ea3ffd7723b8979817093704","user":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":4521794,"name":"nuxeo-drive","full_name":"nuxeo/nuxeo-drive","owner":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars.githubusercontent.com/u/460607?v=3","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo-drive","description":"Nuxeo Drive enables the synchronization of folders or workspaces from the Nuxeo Platform with local folder on your computer.","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo-drive","forks_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo-drive/deployments","created_at":"2012-06-01T16:37:04Z","updated_at":"2016-07-07T17:07:21Z","pushed_at":"2016-07-27T16:52:38Z","git_url":"git://github.com/nuxeo/nuxeo-drive.git","ssh_url":"git@github.com:nuxeo/nuxeo-drive.git","clone_url":"https://github.com/nuxeo/nuxeo-drive.git","svn_url":"https://github.com/nuxeo/nuxeo-drive","homepage":"","size":10413,"stargazers_count":32,"watchers_count":32,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":8,"forks":35,"open_issues":8,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99"},"html":{"href":"https://github.com/nuxeo/nuxeo-drive/pull/99"},"issue":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/99"},"comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/nuxeo/nuxeo-drive/statuses/e5718222bcf59a1b430b2f88373d87c37a61fb44"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":133,"deletions":35,"changed_files":1}}
{"actor":{"display_login":"mconstantin"}}