{"action":"created","comment":{"url":"https://api.github.com/repos/gbiggs/rtshell/pulls/comments/91280703","pull_request_review_id":11787815,"id":91280703,"diff_hunk":"@@ -0,0 +1,144 @@\n+#!/usr/bin/env python2\n+# -*- Python -*-\n+# -*- coding: utf-8 -*-\n+\n+'''rtshell\n+\n+Copyright (C) 2009-2015\n+    Geoffrey Biggs\n+    RT-Synthesis Research Group\n+    Intelligent Systems Research Institute,\n+    National Institute of Advanced Industrial Science and Technology (AIST),\n+    Japan\n+    All rights reserved.\n+Licensed under the GNU Lesser General Public License version 3.\n+http://www.gnu.org/licenses/lgpl-3.0.en.html\n+\n+Implementation of the fsm configuration command.\n+\n+'''\n+\n+from __future__ import print_function\n+\n+\n+import optparse\n+import os\n+import rtctree.exceptions\n+import rtctree.path\n+import rtctree.tree\n+import rtctree.utils\n+import rtctree.rtc.RTC\n+import sys\n+import traceback\n+\n+from rtshell import path\n+from rtshell import rts_exceptions\n+import rtshell\n+\n+\n+def manage_fsm(tgt_raw_path, tgt_full_path, command, argument, options, tree=None):\n+    path, port = rtctree.path.parse_path(tgt_full_path)\n+    if port:\n+        raise rts_exceptions.NotAComponentError(tgt_raw_path)\n+    if not path[-1]:\n+        raise rts_exceptions.NotAComponentError(tgt_raw_path)\n+\n+    if not tree:\n+        tree = rtctree.tree.RTCTree(paths=path, filter=[path])\n+\n+    if not tree.has_path(path):\n+        raise rts_exceptions.NoSuchObjectError(path)\n+    rtc = tree.get_node(path)\n+    if rtc.is_zombie:\n+        raise rts_exceptions.ZombieObjectError(path)\n+    if not rtc.is_component:\n+        raise rts_exceptions.NotAComponentError(path)\n+\n+    fsm = rtc.get_extended_fsm_service()\n+\n+    if command == 'getstate':\n+        print(fsm.get_current_state())\n+    elif command == 'geteventprofiles':\n+        (ret, struct) = fsm.get_fsm_structure()\n+        ps = []\n+        for p in struct.event_profiles:\n+            ps.append(p.name + ':' + p.data_type)\n+        print(','.join(ps))","path":"rtshell/rtfsm.py","position":66,"original_position":66,"commit_id":"82c9fce50ee4579bc5e5fcbb469fed6130248cc1","original_commit_id":"82c9fce50ee4579bc5e5fcbb469fed6130248cc1","user":{"login":"gbiggs","id":163151,"avatar_url":"https://avatars.githubusercontent.com/u/163151?v=3","gravatar_id":"","url":"https://api.github.com/users/gbiggs","html_url":"https://github.com/gbiggs","followers_url":"https://api.github.com/users/gbiggs/followers","following_url":"https://api.github.com/users/gbiggs/following{/other_user}","gists_url":"https://api.github.com/users/gbiggs/gists{/gist_id}","starred_url":"https://api.github.com/users/gbiggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbiggs/subscriptions","organizations_url":"https://api.github.com/users/gbiggs/orgs","repos_url":"https://api.github.com/users/gbiggs/repos","events_url":"https://api.github.com/users/gbiggs/events{/privacy}","received_events_url":"https://api.github.com/users/gbiggs/received_events","type":"User","site_admin":false},"body":"Return a list of strings instead of printing.\r\n\r\nThere should be a space after the comma.","created_at":"2016-12-07T12:13:22Z","updated_at":"2016-12-07T12:33:23Z","html_url":"https://github.com/gbiggs/rtshell/pull/36#discussion_r91280703","pull_request_url":"https://api.github.com/repos/gbiggs/rtshell/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/comments/91280703"},"html":{"href":"https://github.com/gbiggs/rtshell/pull/36#discussion_r91280703"},"pull_request":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/gbiggs/rtshell/pulls/36","id":95600382,"html_url":"https://github.com/gbiggs/rtshell/pull/36","diff_url":"https://github.com/gbiggs/rtshell/pull/36.diff","patch_url":"https://github.com/gbiggs/rtshell/pull/36.patch","issue_url":"https://api.github.com/repos/gbiggs/rtshell/issues/36","number":36,"state":"open","locked":false,"title":"implement command rtwatch and rtfsm","user":{"login":"yosuke","id":18067,"avatar_url":"https://avatars.githubusercontent.com/u/18067?v=3","gravatar_id":"","url":"https://api.github.com/users/yosuke","html_url":"https://github.com/yosuke","followers_url":"https://api.github.com/users/yosuke/followers","following_url":"https://api.github.com/users/yosuke/following{/other_user}","gists_url":"https://api.github.com/users/yosuke/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke/subscriptions","organizations_url":"https://api.github.com/users/yosuke/orgs","repos_url":"https://api.github.com/users/yosuke/repos","events_url":"https://api.github.com/users/yosuke/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke/received_events","type":"User","site_admin":false},"body":"rtwatchコマンドとrtfsmコマンドを実装しています。","created_at":"2016-11-28T23:54:18Z","updated_at":"2016-12-07T12:33:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e1fdfd6d9e8e75a436a8c767c1a5637eab6e008","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gbiggs/rtshell/pulls/36/commits","review_comments_url":"https://api.github.com/repos/gbiggs/rtshell/pulls/36/comments","review_comment_url":"https://api.github.com/repos/gbiggs/rtshell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gbiggs/rtshell/issues/36/comments","statuses_url":"https://api.github.com/repos/gbiggs/rtshell/statuses/82c9fce50ee4579bc5e5fcbb469fed6130248cc1","head":{"label":"yosuke:master","ref":"master","sha":"82c9fce50ee4579bc5e5fcbb469fed6130248cc1","user":{"login":"yosuke","id":18067,"avatar_url":"https://avatars.githubusercontent.com/u/18067?v=3","gravatar_id":"","url":"https://api.github.com/users/yosuke","html_url":"https://github.com/yosuke","followers_url":"https://api.github.com/users/yosuke/followers","following_url":"https://api.github.com/users/yosuke/following{/other_user}","gists_url":"https://api.github.com/users/yosuke/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke/subscriptions","organizations_url":"https://api.github.com/users/yosuke/orgs","repos_url":"https://api.github.com/users/yosuke/repos","events_url":"https://api.github.com/users/yosuke/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke/received_events","type":"User","site_admin":false},"repo":{"id":1349405,"name":"rtshell","full_name":"yosuke/rtshell","owner":{"login":"yosuke","id":18067,"avatar_url":"https://avatars.githubusercontent.com/u/18067?v=3","gravatar_id":"","url":"https://api.github.com/users/yosuke","html_url":"https://github.com/yosuke","followers_url":"https://api.github.com/users/yosuke/followers","following_url":"https://api.github.com/users/yosuke/following{/other_user}","gists_url":"https://api.github.com/users/yosuke/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke/subscriptions","organizations_url":"https://api.github.com/users/yosuke/orgs","repos_url":"https://api.github.com/users/yosuke/repos","events_url":"https://api.github.com/users/yosuke/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yosuke/rtshell","description":"Shell commands for managing RT-Middleware running on OpenRTM-aist.","fork":true,"url":"https://api.github.com/repos/yosuke/rtshell","forks_url":"https://api.github.com/repos/yosuke/rtshell/forks","keys_url":"https://api.github.com/repos/yosuke/rtshell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yosuke/rtshell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yosuke/rtshell/teams","hooks_url":"https://api.github.com/repos/yosuke/rtshell/hooks","issue_events_url":"https://api.github.com/repos/yosuke/rtshell/issues/events{/number}","events_url":"https://api.github.com/repos/yosuke/rtshell/events","assignees_url":"https://api.github.com/repos/yosuke/rtshell/assignees{/user}","branches_url":"https://api.github.com/repos/yosuke/rtshell/branches{/branch}","tags_url":"https://api.github.com/repos/yosuke/rtshell/tags","blobs_url":"https://api.github.com/repos/yosuke/rtshell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yosuke/rtshell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yosuke/rtshell/git/refs{/sha}","trees_url":"https://api.github.com/repos/yosuke/rtshell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yosuke/rtshell/statuses/{sha}","languages_url":"https://api.github.com/repos/yosuke/rtshell/languages","stargazers_url":"https://api.github.com/repos/yosuke/rtshell/stargazers","contributors_url":"https://api.github.com/repos/yosuke/rtshell/contributors","subscribers_url":"https://api.github.com/repos/yosuke/rtshell/subscribers","subscription_url":"https://api.github.com/repos/yosuke/rtshell/subscription","commits_url":"https://api.github.com/repos/yosuke/rtshell/commits{/sha}","git_commits_url":"https://api.github.com/repos/yosuke/rtshell/git/commits{/sha}","comments_url":"https://api.github.com/repos/yosuke/rtshell/comments{/number}","issue_comment_url":"https://api.github.com/repos/yosuke/rtshell/issues/comments{/number}","contents_url":"https://api.github.com/repos/yosuke/rtshell/contents/{+path}","compare_url":"https://api.github.com/repos/yosuke/rtshell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yosuke/rtshell/merges","archive_url":"https://api.github.com/repos/yosuke/rtshell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yosuke/rtshell/downloads","issues_url":"https://api.github.com/repos/yosuke/rtshell/issues{/number}","pulls_url":"https://api.github.com/repos/yosuke/rtshell/pulls{/number}","milestones_url":"https://api.github.com/repos/yosuke/rtshell/milestones{/number}","notifications_url":"https://api.github.com/repos/yosuke/rtshell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yosuke/rtshell/labels{/name}","releases_url":"https://api.github.com/repos/yosuke/rtshell/releases{/id}","deployments_url":"https://api.github.com/repos/yosuke/rtshell/deployments","created_at":"2011-02-10T04:16:48Z","updated_at":"2016-03-07T03:24:51Z","pushed_at":"2016-12-01T02:24:59Z","git_url":"git://github.com/yosuke/rtshell.git","ssh_url":"git@github.com:yosuke/rtshell.git","clone_url":"https://github.com/yosuke/rtshell.git","svn_url":"https://github.com/yosuke/rtshell","homepage":"http://openrtm.org","size":1045,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"gbiggs:master","ref":"master","sha":"5128640b59078b68c438537800314f08ecd241f8","user":{"login":"gbiggs","id":163151,"avatar_url":"https://avatars.githubusercontent.com/u/163151?v=3","gravatar_id":"","url":"https://api.github.com/users/gbiggs","html_url":"https://github.com/gbiggs","followers_url":"https://api.github.com/users/gbiggs/followers","following_url":"https://api.github.com/users/gbiggs/following{/other_user}","gists_url":"https://api.github.com/users/gbiggs/gists{/gist_id}","starred_url":"https://api.github.com/users/gbiggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbiggs/subscriptions","organizations_url":"https://api.github.com/users/gbiggs/orgs","repos_url":"https://api.github.com/users/gbiggs/repos","events_url":"https://api.github.com/users/gbiggs/events{/privacy}","received_events_url":"https://api.github.com/users/gbiggs/received_events","type":"User","site_admin":false},"repo":{"id":708976,"name":"rtshell","full_name":"gbiggs/rtshell","owner":{"login":"gbiggs","id":163151,"avatar_url":"https://avatars.githubusercontent.com/u/163151?v=3","gravatar_id":"","url":"https://api.github.com/users/gbiggs","html_url":"https://github.com/gbiggs","followers_url":"https://api.github.com/users/gbiggs/followers","following_url":"https://api.github.com/users/gbiggs/following{/other_user}","gists_url":"https://api.github.com/users/gbiggs/gists{/gist_id}","starred_url":"https://api.github.com/users/gbiggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbiggs/subscriptions","organizations_url":"https://api.github.com/users/gbiggs/orgs","repos_url":"https://api.github.com/users/gbiggs/repos","events_url":"https://api.github.com/users/gbiggs/events{/privacy}","received_events_url":"https://api.github.com/users/gbiggs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gbiggs/rtshell","description":"Shell commands for managing RT-Middleware running on OpenRTM-aist.","fork":false,"url":"https://api.github.com/repos/gbiggs/rtshell","forks_url":"https://api.github.com/repos/gbiggs/rtshell/forks","keys_url":"https://api.github.com/repos/gbiggs/rtshell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gbiggs/rtshell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gbiggs/rtshell/teams","hooks_url":"https://api.github.com/repos/gbiggs/rtshell/hooks","issue_events_url":"https://api.github.com/repos/gbiggs/rtshell/issues/events{/number}","events_url":"https://api.github.com/repos/gbiggs/rtshell/events","assignees_url":"https://api.github.com/repos/gbiggs/rtshell/assignees{/user}","branches_url":"https://api.github.com/repos/gbiggs/rtshell/branches{/branch}","tags_url":"https://api.github.com/repos/gbiggs/rtshell/tags","blobs_url":"https://api.github.com/repos/gbiggs/rtshell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gbiggs/rtshell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gbiggs/rtshell/git/refs{/sha}","trees_url":"https://api.github.com/repos/gbiggs/rtshell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gbiggs/rtshell/statuses/{sha}","languages_url":"https://api.github.com/repos/gbiggs/rtshell/languages","stargazers_url":"https://api.github.com/repos/gbiggs/rtshell/stargazers","contributors_url":"https://api.github.com/repos/gbiggs/rtshell/contributors","subscribers_url":"https://api.github.com/repos/gbiggs/rtshell/subscribers","subscription_url":"https://api.github.com/repos/gbiggs/rtshell/subscription","commits_url":"https://api.github.com/repos/gbiggs/rtshell/commits{/sha}","git_commits_url":"https://api.github.com/repos/gbiggs/rtshell/git/commits{/sha}","comments_url":"https://api.github.com/repos/gbiggs/rtshell/comments{/number}","issue_comment_url":"https://api.github.com/repos/gbiggs/rtshell/issues/comments{/number}","contents_url":"https://api.github.com/repos/gbiggs/rtshell/contents/{+path}","compare_url":"https://api.github.com/repos/gbiggs/rtshell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gbiggs/rtshell/merges","archive_url":"https://api.github.com/repos/gbiggs/rtshell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gbiggs/rtshell/downloads","issues_url":"https://api.github.com/repos/gbiggs/rtshell/issues{/number}","pulls_url":"https://api.github.com/repos/gbiggs/rtshell/pulls{/number}","milestones_url":"https://api.github.com/repos/gbiggs/rtshell/milestones{/number}","notifications_url":"https://api.github.com/repos/gbiggs/rtshell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gbiggs/rtshell/labels{/name}","releases_url":"https://api.github.com/repos/gbiggs/rtshell/releases{/id}","deployments_url":"https://api.github.com/repos/gbiggs/rtshell/deployments","created_at":"2010-06-08T06:43:26Z","updated_at":"2015-04-23T06:51:36Z","pushed_at":"2016-12-01T02:25:00Z","git_url":"git://github.com/gbiggs/rtshell.git","ssh_url":"git@github.com:gbiggs/rtshell.git","clone_url":"https://github.com/gbiggs/rtshell.git","svn_url":"https://github.com/gbiggs/rtshell","homepage":"http://openrtm.org","size":1128,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":8,"forks":8,"open_issues":8,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/36"},"html":{"href":"https://github.com/gbiggs/rtshell/pull/36"},"issue":{"href":"https://api.github.com/repos/gbiggs/rtshell/issues/36"},"comments":{"href":"https://api.github.com/repos/gbiggs/rtshell/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gbiggs/rtshell/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/gbiggs/rtshell/statuses/82c9fce50ee4579bc5e5fcbb469fed6130248cc1"}}}}
{"actor":{"display_login":"gbiggs"}}