{"action":"created","comment":{"url":"https://api.github.com/repos/jaymzh/pius/pulls/comments/219438288","pull_request_review_id":157613696,"id":219438288,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTQzODI4OA==","diff_hunk":"@@ -0,0 +1,119 @@\n+'''A set of path functions and variables for the PIUS suite.'''\n+from __future__ import print_function\n+\n+import os\n+import sys\n+import stat\n+from os.path import abspath\n+import fnmatch\n+\n+'''This is grabbed right from the python repo under lib/shutil.py'''\n+\n+def which(cmd, mode=os.F_OK | os.X_OK, path=None):\n+    \"\"\"Given a command, mode, and a PATH string, return the path which\n+    conforms to the given mode on the PATH, or None if there is no such\n+    file.\n+    `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result\n+    of os.environ.get(\"PATH\"), or can be overridden with a custom search\n+    path.\n+    \"\"\"\n+    # Check that a given file can be accessed with the correct mode.\n+    # Additionally check that `file` is not a directory, as on Windows\n+    # directories pass the os.access check.\n+    def _access_check(fn, mode):\n+        return (os.path.exists(fn) and os.access(fn, mode)\n+                and not os.path.isdir(fn))\n+\n+    # If we're given a path with a directory part, look it up directly rather\n+    # than referring to PATH directories. This includes checking relative to the\n+    # current directory, e.g. ./script\n+    if os.path.dirname(cmd):\n+        if _access_check(cmd, mode):\n+            return cmd\n+        return None\n+\n+    if path is None:\n+        path = os.environ.get(\"PATH\", os.defpath)\n+    if not path:\n+        return None\n+    path = path.split(os.pathsep)\n+\n+    if sys.platform == \"win32\":\n+        # The current directory takes precedence on Windows.\n+        if not os.curdir in path:\n+            path.insert(0, os.curdir)\n+\n+        # PATHEXT is necessary to check on Windows.\n+        pathext = os.environ.get(\"PATHEXT\", \"\").split(os.pathsep)\n+        # See if the given file matches any of the expected path extensions.\n+        # This will allow us to short circuit when given \"python.exe\".\n+        # If it does match, only test that one, otherwise we have to try\n+        # others.\n+        if any(cmd.lower().endswith(ext.lower()) for ext in pathext):\n+            files = [cmd]\n+        else:\n+            files = [cmd + ext for ext in pathext]\n+    else:\n+        # On other platforms you don't have things like PATHEXT to tell you\n+        # what file suffixes are executable, so just pass on cmd as-is.\n+        files = [cmd]\n+\n+    seen = set()\n+    for dir in path:\n+        normdir = os.path.normcase(dir)\n+        if not normdir in seen:\n+            seen.add(normdir)\n+            for thefile in files:\n+                name = os.path.join(dir, thefile)\n+                if _access_check(name, mode):\n+                    return name\n+    return None\n+\n+def gpg_test():\n+    gpg = which('gpg2')\n+    if gpg == \"\":\n+        print(\"GPG2 could not be found! Is it accessable to $PATH?\")\n+        sys.exit(1)\n+    else:\n+        return gpg\n+\n+def get_home():\n+    if sys.platform == \"win32\":","path":"libpius/path.py","position":86,"original_position":81,"commit_id":"41b9bf6feca530f290e1a341677a9d2ee208c6d1","original_commit_id":"d4fb2847684edeee308e60f510107d184f43da2a","user":{"login":"jaymzh","id":938467,"node_id":"MDQ6VXNlcjkzODQ2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/938467?v=4","gravatar_id":"","url":"https://api.github.com/users/jaymzh","html_url":"https://github.com/jaymzh","followers_url":"https://api.github.com/users/jaymzh/followers","following_url":"https://api.github.com/users/jaymzh/following{/other_user}","gists_url":"https://api.github.com/users/jaymzh/gists{/gist_id}","starred_url":"https://api.github.com/users/jaymzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaymzh/subscriptions","organizations_url":"https://api.github.com/users/jaymzh/orgs","repos_url":"https://api.github.com/users/jaymzh/repos","events_url":"https://api.github.com/users/jaymzh/events{/privacy}","received_events_url":"https://api.github.com/users/jaymzh/received_events","type":"User","site_admin":false},"body":"I know it's Windows. But I thought windows *also* had a HOME in addition to APPDATA so this would mean existing windows users would have their data in HOME/.piusrc, but we'd be looking for in in APPDATA/.piusrc - I don't want to break backcopmat for people","created_at":"2018-09-21T09:31:27Z","updated_at":"2018-09-21T09:31:27Z","html_url":"https://github.com/jaymzh/pius/pull/104#discussion_r219438288","pull_request_url":"https://api.github.com/repos/jaymzh/pius/pulls/104","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/comments/219438288"},"html":{"href":"https://github.com/jaymzh/pius/pull/104#discussion_r219438288"},"pull_request":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/104"}},"in_reply_to_id":219391224},"pull_request":{"url":"https://api.github.com/repos/jaymzh/pius/pulls/104","id":214798443,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0Nzk4NDQz","html_url":"https://github.com/jaymzh/pius/pull/104","diff_url":"https://github.com/jaymzh/pius/pull/104.diff","patch_url":"https://github.com/jaymzh/pius/pull/104.patch","issue_url":"https://api.github.com/repos/jaymzh/pius/issues/104","number":104,"state":"open","locked":false,"title":"Fixed pathing for OSes (GPG, TMP, Home, etc. for Windows/Linux/Unix)","user":{"login":"F9Alejandro","id":1888010,"node_id":"MDQ6VXNlcjE4ODgwMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1888010?v=4","gravatar_id":"","url":"https://api.github.com/users/F9Alejandro","html_url":"https://github.com/F9Alejandro","followers_url":"https://api.github.com/users/F9Alejandro/followers","following_url":"https://api.github.com/users/F9Alejandro/following{/other_user}","gists_url":"https://api.github.com/users/F9Alejandro/gists{/gist_id}","starred_url":"https://api.github.com/users/F9Alejandro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F9Alejandro/subscriptions","organizations_url":"https://api.github.com/users/F9Alejandro/orgs","repos_url":"https://api.github.com/users/F9Alejandro/repos","events_url":"https://api.github.com/users/F9Alejandro/events{/privacy}","received_events_url":"https://api.github.com/users/F9Alejandro/received_events","type":"User","site_admin":false},"body":"Updated single commit to better track/organize for pulling.\r\n\r\nlibpius/path.py handles pathing of the local machine and determines what to use or do based on the host OS.\r\n\r\nset_tmpdir() is hard coded for Mac (Darwin) and linux as $TMPDIR doesn't respond correctly or is not an env variable in varying versions. \r\n\r\n(Note: MacOS uses mktemp which is not able to be accessed by anyone* except the user, some versions of linux use $TMP/$TEMP/$TMPDIR/$TEMPDIR or just doesn't exist at all)\r\n*includes root","created_at":"2018-09-11T23:50:29Z","updated_at":"2018-09-21T09:31:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2057801315687b009be4b3e450efa8a3a951dcf0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jaymzh/pius/pulls/104/commits","review_comments_url":"https://api.github.com/repos/jaymzh/pius/pulls/104/comments","review_comment_url":"https://api.github.com/repos/jaymzh/pius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jaymzh/pius/issues/104/comments","statuses_url":"https://api.github.com/repos/jaymzh/pius/statuses/41b9bf6feca530f290e1a341677a9d2ee208c6d1","head":{"label":"F9Alejandro:3_work","ref":"3_work","sha":"41b9bf6feca530f290e1a341677a9d2ee208c6d1","user":{"login":"F9Alejandro","id":1888010,"node_id":"MDQ6VXNlcjE4ODgwMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1888010?v=4","gravatar_id":"","url":"https://api.github.com/users/F9Alejandro","html_url":"https://github.com/F9Alejandro","followers_url":"https://api.github.com/users/F9Alejandro/followers","following_url":"https://api.github.com/users/F9Alejandro/following{/other_user}","gists_url":"https://api.github.com/users/F9Alejandro/gists{/gist_id}","starred_url":"https://api.github.com/users/F9Alejandro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F9Alejandro/subscriptions","organizations_url":"https://api.github.com/users/F9Alejandro/orgs","repos_url":"https://api.github.com/users/F9Alejandro/repos","events_url":"https://api.github.com/users/F9Alejandro/events{/privacy}","received_events_url":"https://api.github.com/users/F9Alejandro/received_events","type":"User","site_admin":false},"repo":{"id":148139295,"node_id":"MDEwOlJlcG9zaXRvcnkxNDgxMzkyOTU=","name":"pius","full_name":"F9Alejandro/pius","private":false,"owner":{"login":"F9Alejandro","id":1888010,"node_id":"MDQ6VXNlcjE4ODgwMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1888010?v=4","gravatar_id":"","url":"https://api.github.com/users/F9Alejandro","html_url":"https://github.com/F9Alejandro","followers_url":"https://api.github.com/users/F9Alejandro/followers","following_url":"https://api.github.com/users/F9Alejandro/following{/other_user}","gists_url":"https://api.github.com/users/F9Alejandro/gists{/gist_id}","starred_url":"https://api.github.com/users/F9Alejandro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F9Alejandro/subscriptions","organizations_url":"https://api.github.com/users/F9Alejandro/orgs","repos_url":"https://api.github.com/users/F9Alejandro/repos","events_url":"https://api.github.com/users/F9Alejandro/events{/privacy}","received_events_url":"https://api.github.com/users/F9Alejandro/received_events","type":"User","site_admin":false},"html_url":"https://github.com/F9Alejandro/pius","description":"PGP Individual User Signer","fork":true,"url":"https://api.github.com/repos/F9Alejandro/pius","forks_url":"https://api.github.com/repos/F9Alejandro/pius/forks","keys_url":"https://api.github.com/repos/F9Alejandro/pius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/F9Alejandro/pius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/F9Alejandro/pius/teams","hooks_url":"https://api.github.com/repos/F9Alejandro/pius/hooks","issue_events_url":"https://api.github.com/repos/F9Alejandro/pius/issues/events{/number}","events_url":"https://api.github.com/repos/F9Alejandro/pius/events","assignees_url":"https://api.github.com/repos/F9Alejandro/pius/assignees{/user}","branches_url":"https://api.github.com/repos/F9Alejandro/pius/branches{/branch}","tags_url":"https://api.github.com/repos/F9Alejandro/pius/tags","blobs_url":"https://api.github.com/repos/F9Alejandro/pius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/F9Alejandro/pius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/F9Alejandro/pius/git/refs{/sha}","trees_url":"https://api.github.com/repos/F9Alejandro/pius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/F9Alejandro/pius/statuses/{sha}","languages_url":"https://api.github.com/repos/F9Alejandro/pius/languages","stargazers_url":"https://api.github.com/repos/F9Alejandro/pius/stargazers","contributors_url":"https://api.github.com/repos/F9Alejandro/pius/contributors","subscribers_url":"https://api.github.com/repos/F9Alejandro/pius/subscribers","subscription_url":"https://api.github.com/repos/F9Alejandro/pius/subscription","commits_url":"https://api.github.com/repos/F9Alejandro/pius/commits{/sha}","git_commits_url":"https://api.github.com/repos/F9Alejandro/pius/git/commits{/sha}","comments_url":"https://api.github.com/repos/F9Alejandro/pius/comments{/number}","issue_comment_url":"https://api.github.com/repos/F9Alejandro/pius/issues/comments{/number}","contents_url":"https://api.github.com/repos/F9Alejandro/pius/contents/{+path}","compare_url":"https://api.github.com/repos/F9Alejandro/pius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/F9Alejandro/pius/merges","archive_url":"https://api.github.com/repos/F9Alejandro/pius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/F9Alejandro/pius/downloads","issues_url":"https://api.github.com/repos/F9Alejandro/pius/issues{/number}","pulls_url":"https://api.github.com/repos/F9Alejandro/pius/pulls{/number}","milestones_url":"https://api.github.com/repos/F9Alejandro/pius/milestones{/number}","notifications_url":"https://api.github.com/repos/F9Alejandro/pius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/F9Alejandro/pius/labels{/name}","releases_url":"https://api.github.com/repos/F9Alejandro/pius/releases{/id}","deployments_url":"https://api.github.com/repos/F9Alejandro/pius/deployments","created_at":"2018-09-10T10:34:18Z","updated_at":"2018-09-10T10:34:19Z","pushed_at":"2018-09-21T08:50:37Z","git_url":"git://github.com/F9Alejandro/pius.git","ssh_url":"git@github.com:F9Alejandro/pius.git","clone_url":"https://github.com/F9Alejandro/pius.git","svn_url":"https://github.com/F9Alejandro/pius","homepage":"http://www.phildev.net/pius/","size":290,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jaymzh:3_work","ref":"3_work","sha":"a480b545e02377094a2a19c49cb7af68aff803ec","user":{"login":"jaymzh","id":938467,"node_id":"MDQ6VXNlcjkzODQ2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/938467?v=4","gravatar_id":"","url":"https://api.github.com/users/jaymzh","html_url":"https://github.com/jaymzh","followers_url":"https://api.github.com/users/jaymzh/followers","following_url":"https://api.github.com/users/jaymzh/following{/other_user}","gists_url":"https://api.github.com/users/jaymzh/gists{/gist_id}","starred_url":"https://api.github.com/users/jaymzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaymzh/subscriptions","organizations_url":"https://api.github.com/users/jaymzh/orgs","repos_url":"https://api.github.com/users/jaymzh/repos","events_url":"https://api.github.com/users/jaymzh/events{/privacy}","received_events_url":"https://api.github.com/users/jaymzh/received_events","type":"User","site_admin":false},"repo":{"id":34893704,"node_id":"MDEwOlJlcG9zaXRvcnkzNDg5MzcwNA==","name":"pius","full_name":"jaymzh/pius","private":false,"owner":{"login":"jaymzh","id":938467,"node_id":"MDQ6VXNlcjkzODQ2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/938467?v=4","gravatar_id":"","url":"https://api.github.com/users/jaymzh","html_url":"https://github.com/jaymzh","followers_url":"https://api.github.com/users/jaymzh/followers","following_url":"https://api.github.com/users/jaymzh/following{/other_user}","gists_url":"https://api.github.com/users/jaymzh/gists{/gist_id}","starred_url":"https://api.github.com/users/jaymzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaymzh/subscriptions","organizations_url":"https://api.github.com/users/jaymzh/orgs","repos_url":"https://api.github.com/users/jaymzh/repos","events_url":"https://api.github.com/users/jaymzh/events{/privacy}","received_events_url":"https://api.github.com/users/jaymzh/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jaymzh/pius","description":"PGP Individual User Signer","fork":false,"url":"https://api.github.com/repos/jaymzh/pius","forks_url":"https://api.github.com/repos/jaymzh/pius/forks","keys_url":"https://api.github.com/repos/jaymzh/pius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaymzh/pius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaymzh/pius/teams","hooks_url":"https://api.github.com/repos/jaymzh/pius/hooks","issue_events_url":"https://api.github.com/repos/jaymzh/pius/issues/events{/number}","events_url":"https://api.github.com/repos/jaymzh/pius/events","assignees_url":"https://api.github.com/repos/jaymzh/pius/assignees{/user}","branches_url":"https://api.github.com/repos/jaymzh/pius/branches{/branch}","tags_url":"https://api.github.com/repos/jaymzh/pius/tags","blobs_url":"https://api.github.com/repos/jaymzh/pius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaymzh/pius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaymzh/pius/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaymzh/pius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaymzh/pius/statuses/{sha}","languages_url":"https://api.github.com/repos/jaymzh/pius/languages","stargazers_url":"https://api.github.com/repos/jaymzh/pius/stargazers","contributors_url":"https://api.github.com/repos/jaymzh/pius/contributors","subscribers_url":"https://api.github.com/repos/jaymzh/pius/subscribers","subscription_url":"https://api.github.com/repos/jaymzh/pius/subscription","commits_url":"https://api.github.com/repos/jaymzh/pius/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaymzh/pius/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaymzh/pius/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaymzh/pius/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaymzh/pius/contents/{+path}","compare_url":"https://api.github.com/repos/jaymzh/pius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaymzh/pius/merges","archive_url":"https://api.github.com/repos/jaymzh/pius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaymzh/pius/downloads","issues_url":"https://api.github.com/repos/jaymzh/pius/issues{/number}","pulls_url":"https://api.github.com/repos/jaymzh/pius/pulls{/number}","milestones_url":"https://api.github.com/repos/jaymzh/pius/milestones{/number}","notifications_url":"https://api.github.com/repos/jaymzh/pius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaymzh/pius/labels{/name}","releases_url":"https://api.github.com/repos/jaymzh/pius/releases{/id}","deployments_url":"https://api.github.com/repos/jaymzh/pius/deployments","created_at":"2015-05-01T07:36:05Z","updated_at":"2018-09-10T21:55:26Z","pushed_at":"2018-09-21T08:50:37Z","git_url":"git://github.com/jaymzh/pius.git","ssh_url":"git@github.com:jaymzh/pius.git","clone_url":"https://github.com/jaymzh/pius.git","svn_url":"https://github.com/jaymzh/pius","homepage":"http://www.phildev.net/pius/","size":249,"stargazers_count":47,"watchers_count":47,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":23,"open_issues":17,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/104"},"html":{"href":"https://github.com/jaymzh/pius/pull/104"},"issue":{"href":"https://api.github.com/repos/jaymzh/pius/issues/104"},"comments":{"href":"https://api.github.com/repos/jaymzh/pius/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jaymzh/pius/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/jaymzh/pius/statuses/41b9bf6feca530f290e1a341677a9d2ee208c6d1"}},"author_association":"NONE"}}
{"actor":{"display_login":"jaymzh"}}