{"action":"created","comment":{"url":"https://api.github.com/repos/ejeschke/ginga/pulls/comments/79490872","id":79490872,"diff_hunk":"@@ -0,0 +1,138 @@\n+#\n+# TableView.py -- Table viewer for Ginga\n+#\n+# This is open-source software licensed under a BSD license.\n+# Please see the file LICENSE.txt for details.\n+#\n+from collections import OrderedDict\n+\n+from ginga.misc import Callback, Settings\n+from ginga.misc import Bunch\n+from ginga.util.six.moves import zip\n+\n+\n+class TableViewBase(Callback.Callbacks):\n+    \"\"\"An abstract base class for displaying tables represented by\n+    astropy table objects.\n+\n+    Parameters\n+    ----------\n+    logger : :py:class:`~logging.Logger` or `None`\n+        Logger for tracing and debugging. If not given, one will be created.\n+\n+    settings : `~ginga.misc.Settings.SettingGroup` or `None`\n+        Viewer preferences. If not given, one will be created.\n+\n+    \"\"\"\n+    def __init__(self, logger=None, settings=None):\n+        Callback.Callbacks.__init__(self)\n+\n+        if logger is not None:\n+            self.logger = logger\n+        else:\n+            self.logger = logging.Logger('TableViewBase')\n+\n+        # Create settings and set defaults\n+        if settings is None:\n+            settings = Settings.SettingGroup(logger=self.logger)\n+        self.settings = settings\n+\n+        # for debugging\n+        self.name = str(self)\n+\n+        self.settings.addDefaults(color_alternate_rows=True,\n+                                  max_rows_for_col_resize=5000)\n+\n+        # For callbacks\n+        for name in ('table-set', 'configure', ):\n+            self.enable_callback(name)\n+\n+    def get_settings(self):\n+        \"\"\"Get the settings used by this instance.\n+\n+        Returns\n+        -------\n+        settings : `~ginga.misc.Settings.SettingGroup`\n+            Settings.\n+\n+        \"\"\"\n+        return self.settings\n+\n+    def get_logger(self):\n+        \"\"\"Get the logger used by this instance.\n+\n+        Returns\n+        -------\n+        logger : :py:class:`~logging.Logger`\n+            Logger.\n+\n+        \"\"\"\n+        return self.logger\n+\n+    def set_table(self, table):\n+        self._table = table\n+\n+        self.make_callback('table-set', table)\n+\n+    def get_table(self):\n+        return self._table\n+\n+    # for compatibility with ImageView\n+    get_image = get_table\n+\n+\n+class TableViewGw(TableViewBase):\n+\n+    def __init__(self, logger=None, settings=None):\n+        super(TableViewGw, self).__init__(logger=logger, settings=settings)\n+\n+        self.add_callback('table-set', self.set_table_cb)\n+\n+        from ginga.gw import Widgets\n+\n+        # Create the viewer as a Treeview widget\n+        color_alternate = self.settings.get('color_alternate_rows', True)","path":"ginga/table/TableView.py","position":94,"original_position":94,"commit_id":"5f713f593595562e21f3de1acb84d438df860377","original_commit_id":"5f713f593595562e21f3de1acb84d438df860377","user":{"login":"ejeschke","id":1305473,"avatar_url":"https://avatars.githubusercontent.com/u/1305473?v=3","gravatar_id":"","url":"https://api.github.com/users/ejeschke","html_url":"https://github.com/ejeschke","followers_url":"https://api.github.com/users/ejeschke/followers","following_url":"https://api.github.com/users/ejeschke/following{/other_user}","gists_url":"https://api.github.com/users/ejeschke/gists{/gist_id}","starred_url":"https://api.github.com/users/ejeschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejeschke/subscriptions","organizations_url":"https://api.github.com/users/ejeschke/orgs","repos_url":"https://api.github.com/users/ejeschke/repos","events_url":"https://api.github.com/users/ejeschke/events{/privacy}","received_events_url":"https://api.github.com/users/ejeschke/received_events","type":"User","site_admin":false},"body":"I think this is sharing the basic channel settings (e.g. `channel_Image.cfg`).","created_at":"2016-09-19T21:15:28Z","updated_at":"2016-09-19T21:15:28Z","html_url":"https://github.com/ejeschke/ginga/pull/370#discussion_r79490872","pull_request_url":"https://api.github.com/repos/ejeschke/ginga/pulls/370","_links":{"self":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/comments/79490872"},"html":{"href":"https://github.com/ejeschke/ginga/pull/370#discussion_r79490872"},"pull_request":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/370"}}},"pull_request":{"url":"https://api.github.com/repos/ejeschke/ginga/pulls/370","id":85864191,"html_url":"https://github.com/ejeschke/ginga/pull/370","diff_url":"https://github.com/ejeschke/ginga/pull/370.diff","patch_url":"https://github.com/ejeschke/ginga/pull/370.patch","issue_url":"https://api.github.com/repos/ejeschke/ginga/issues/370","number":370,"state":"open","locked":false,"title":"Adding a table viewer to Ginga reference viewer","user":{"login":"ejeschke","id":1305473,"avatar_url":"https://avatars.githubusercontent.com/u/1305473?v=3","gravatar_id":"","url":"https://api.github.com/users/ejeschke","html_url":"https://github.com/ejeschke","followers_url":"https://api.github.com/users/ejeschke/followers","following_url":"https://api.github.com/users/ejeschke/following{/other_user}","gists_url":"https://api.github.com/users/ejeschke/gists{/gist_id}","starred_url":"https://api.github.com/users/ejeschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejeschke/subscriptions","organizations_url":"https://api.github.com/users/ejeschke/orgs","repos_url":"https://api.github.com/users/ejeschke/repos","events_url":"https://api.github.com/users/ejeschke/events{/privacy}","received_events_url":"https://api.github.com/users/ejeschke/received_events","type":"User","site_admin":false},"body":"see github.com issue #368","created_at":"2016-09-19T20:33:32Z","updated_at":"2016-09-19T21:15:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44fe15dc1fd2fcd31d63ac3454186f9ff3326961","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ejeschke/ginga/pulls/370/commits","review_comments_url":"https://api.github.com/repos/ejeschke/ginga/pulls/370/comments","review_comment_url":"https://api.github.com/repos/ejeschke/ginga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ejeschke/ginga/issues/370/comments","statuses_url":"https://api.github.com/repos/ejeschke/ginga/statuses/5f713f593595562e21f3de1acb84d438df860377","head":{"label":"naojsoft:table-viewer","ref":"table-viewer","sha":"5f713f593595562e21f3de1acb84d438df860377","user":{"login":"naojsoft","id":13684419,"avatar_url":"https://avatars.githubusercontent.com/u/13684419?v=3","gravatar_id":"","url":"https://api.github.com/users/naojsoft","html_url":"https://github.com/naojsoft","followers_url":"https://api.github.com/users/naojsoft/followers","following_url":"https://api.github.com/users/naojsoft/following{/other_user}","gists_url":"https://api.github.com/users/naojsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/naojsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naojsoft/subscriptions","organizations_url":"https://api.github.com/users/naojsoft/orgs","repos_url":"https://api.github.com/users/naojsoft/repos","events_url":"https://api.github.com/users/naojsoft/events{/privacy}","received_events_url":"https://api.github.com/users/naojsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":46200937,"name":"ginga","full_name":"naojsoft/ginga","owner":{"login":"naojsoft","id":13684419,"avatar_url":"https://avatars.githubusercontent.com/u/13684419?v=3","gravatar_id":"","url":"https://api.github.com/users/naojsoft","html_url":"https://github.com/naojsoft","followers_url":"https://api.github.com/users/naojsoft/followers","following_url":"https://api.github.com/users/naojsoft/following{/other_user}","gists_url":"https://api.github.com/users/naojsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/naojsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naojsoft/subscriptions","organizations_url":"https://api.github.com/users/naojsoft/orgs","repos_url":"https://api.github.com/users/naojsoft/repos","events_url":"https://api.github.com/users/naojsoft/events{/privacy}","received_events_url":"https://api.github.com/users/naojsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/naojsoft/ginga","description":"The Ginga astronomical FITS file viewer","fork":true,"url":"https://api.github.com/repos/naojsoft/ginga","forks_url":"https://api.github.com/repos/naojsoft/ginga/forks","keys_url":"https://api.github.com/repos/naojsoft/ginga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naojsoft/ginga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naojsoft/ginga/teams","hooks_url":"https://api.github.com/repos/naojsoft/ginga/hooks","issue_events_url":"https://api.github.com/repos/naojsoft/ginga/issues/events{/number}","events_url":"https://api.github.com/repos/naojsoft/ginga/events","assignees_url":"https://api.github.com/repos/naojsoft/ginga/assignees{/user}","branches_url":"https://api.github.com/repos/naojsoft/ginga/branches{/branch}","tags_url":"https://api.github.com/repos/naojsoft/ginga/tags","blobs_url":"https://api.github.com/repos/naojsoft/ginga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naojsoft/ginga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naojsoft/ginga/git/refs{/sha}","trees_url":"https://api.github.com/repos/naojsoft/ginga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naojsoft/ginga/statuses/{sha}","languages_url":"https://api.github.com/repos/naojsoft/ginga/languages","stargazers_url":"https://api.github.com/repos/naojsoft/ginga/stargazers","contributors_url":"https://api.github.com/repos/naojsoft/ginga/contributors","subscribers_url":"https://api.github.com/repos/naojsoft/ginga/subscribers","subscription_url":"https://api.github.com/repos/naojsoft/ginga/subscription","commits_url":"https://api.github.com/repos/naojsoft/ginga/commits{/sha}","git_commits_url":"https://api.github.com/repos/naojsoft/ginga/git/commits{/sha}","comments_url":"https://api.github.com/repos/naojsoft/ginga/comments{/number}","issue_comment_url":"https://api.github.com/repos/naojsoft/ginga/issues/comments{/number}","contents_url":"https://api.github.com/repos/naojsoft/ginga/contents/{+path}","compare_url":"https://api.github.com/repos/naojsoft/ginga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naojsoft/ginga/merges","archive_url":"https://api.github.com/repos/naojsoft/ginga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naojsoft/ginga/downloads","issues_url":"https://api.github.com/repos/naojsoft/ginga/issues{/number}","pulls_url":"https://api.github.com/repos/naojsoft/ginga/pulls{/number}","milestones_url":"https://api.github.com/repos/naojsoft/ginga/milestones{/number}","notifications_url":"https://api.github.com/repos/naojsoft/ginga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naojsoft/ginga/labels{/name}","releases_url":"https://api.github.com/repos/naojsoft/ginga/releases{/id}","deployments_url":"https://api.github.com/repos/naojsoft/ginga/deployments","created_at":"2015-11-15T02:25:01Z","updated_at":"2016-02-03T00:39:00Z","pushed_at":"2016-09-19T20:32:32Z","git_url":"git://github.com/naojsoft/ginga.git","ssh_url":"git@github.com:naojsoft/ginga.git","clone_url":"https://github.com/naojsoft/ginga.git","svn_url":"https://github.com/naojsoft/ginga","homepage":null,"size":27118,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ejeschke:master","ref":"master","sha":"14b37a494ac60df84ce3b9c4f921ca0016e18d86","user":{"login":"ejeschke","id":1305473,"avatar_url":"https://avatars.githubusercontent.com/u/1305473?v=3","gravatar_id":"","url":"https://api.github.com/users/ejeschke","html_url":"https://github.com/ejeschke","followers_url":"https://api.github.com/users/ejeschke/followers","following_url":"https://api.github.com/users/ejeschke/following{/other_user}","gists_url":"https://api.github.com/users/ejeschke/gists{/gist_id}","starred_url":"https://api.github.com/users/ejeschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejeschke/subscriptions","organizations_url":"https://api.github.com/users/ejeschke/orgs","repos_url":"https://api.github.com/users/ejeschke/repos","events_url":"https://api.github.com/users/ejeschke/events{/privacy}","received_events_url":"https://api.github.com/users/ejeschke/received_events","type":"User","site_admin":false},"repo":{"id":4758330,"name":"ginga","full_name":"ejeschke/ginga","owner":{"login":"ejeschke","id":1305473,"avatar_url":"https://avatars.githubusercontent.com/u/1305473?v=3","gravatar_id":"","url":"https://api.github.com/users/ejeschke","html_url":"https://github.com/ejeschke","followers_url":"https://api.github.com/users/ejeschke/followers","following_url":"https://api.github.com/users/ejeschke/following{/other_user}","gists_url":"https://api.github.com/users/ejeschke/gists{/gist_id}","starred_url":"https://api.github.com/users/ejeschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejeschke/subscriptions","organizations_url":"https://api.github.com/users/ejeschke/orgs","repos_url":"https://api.github.com/users/ejeschke/repos","events_url":"https://api.github.com/users/ejeschke/events{/privacy}","received_events_url":"https://api.github.com/users/ejeschke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejeschke/ginga","description":"The Ginga astronomical FITS file viewer","fork":false,"url":"https://api.github.com/repos/ejeschke/ginga","forks_url":"https://api.github.com/repos/ejeschke/ginga/forks","keys_url":"https://api.github.com/repos/ejeschke/ginga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejeschke/ginga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejeschke/ginga/teams","hooks_url":"https://api.github.com/repos/ejeschke/ginga/hooks","issue_events_url":"https://api.github.com/repos/ejeschke/ginga/issues/events{/number}","events_url":"https://api.github.com/repos/ejeschke/ginga/events","assignees_url":"https://api.github.com/repos/ejeschke/ginga/assignees{/user}","branches_url":"https://api.github.com/repos/ejeschke/ginga/branches{/branch}","tags_url":"https://api.github.com/repos/ejeschke/ginga/tags","blobs_url":"https://api.github.com/repos/ejeschke/ginga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejeschke/ginga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejeschke/ginga/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejeschke/ginga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejeschke/ginga/statuses/{sha}","languages_url":"https://api.github.com/repos/ejeschke/ginga/languages","stargazers_url":"https://api.github.com/repos/ejeschke/ginga/stargazers","contributors_url":"https://api.github.com/repos/ejeschke/ginga/contributors","subscribers_url":"https://api.github.com/repos/ejeschke/ginga/subscribers","subscription_url":"https://api.github.com/repos/ejeschke/ginga/subscription","commits_url":"https://api.github.com/repos/ejeschke/ginga/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejeschke/ginga/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejeschke/ginga/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejeschke/ginga/issues/comments{/number}","contents_url":"https://api.github.com/repos/ejeschke/ginga/contents/{+path}","compare_url":"https://api.github.com/repos/ejeschke/ginga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejeschke/ginga/merges","archive_url":"https://api.github.com/repos/ejeschke/ginga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejeschke/ginga/downloads","issues_url":"https://api.github.com/repos/ejeschke/ginga/issues{/number}","pulls_url":"https://api.github.com/repos/ejeschke/ginga/pulls{/number}","milestones_url":"https://api.github.com/repos/ejeschke/ginga/milestones{/number}","notifications_url":"https://api.github.com/repos/ejeschke/ginga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejeschke/ginga/labels{/name}","releases_url":"https://api.github.com/repos/ejeschke/ginga/releases{/id}","deployments_url":"https://api.github.com/repos/ejeschke/ginga/deployments","created_at":"2012-06-23T04:03:05Z","updated_at":"2016-08-31T21:54:08Z","pushed_at":"2016-09-19T21:02:51Z","git_url":"git://github.com/ejeschke/ginga.git","ssh_url":"git@github.com:ejeschke/ginga.git","clone_url":"https://github.com/ejeschke/ginga.git","svn_url":"https://github.com/ejeschke/ginga","homepage":null,"size":27106,"stargazers_count":56,"watchers_count":56,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":43,"mirror_url":null,"open_issues_count":63,"forks":43,"open_issues":63,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/370"},"html":{"href":"https://github.com/ejeschke/ginga/pull/370"},"issue":{"href":"https://api.github.com/repos/ejeschke/ginga/issues/370"},"comments":{"href":"https://api.github.com/repos/ejeschke/ginga/issues/370/comments"},"review_comments":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/370/comments"},"review_comment":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ejeschke/ginga/pulls/370/commits"},"statuses":{"href":"https://api.github.com/repos/ejeschke/ginga/statuses/5f713f593595562e21f3de1acb84d438df860377"}}}}
{"actor":{"display_login":"ejeschke"}}