{"action":"created","comment":{"url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/comments/63841072","id":63841072,"diff_hunk":"@@ -0,0 +1,137 @@\n+# This file is part of the ISIS IBEX application.\n+# Copyright (C) 2012-2016 Science & Technology Facilities Council.\n+# All rights reserved.\n+#\n+# This program is distributed in the hope that it will be useful.\n+# This program and the accompanying materials are made available under the\n+# terms of the Eclipse Public License v1.0 which accompanies this distribution.\n+# EXCEPT AS EXPRESSLY SET FORTH IN THE ECLIPSE PUBLIC LICENSE V1.0, THE PROGRAM\n+# AND ACCOMPANYING MATERIALS ARE PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES\n+# OR CONDITIONS OF ANY KIND.  See the Eclipse Public License v1.0 for more details.\n+#\n+# You should have received a copy of the Eclipse Public License v1.0\n+# along with this program; if not, you can obtain a copy from\n+# https://www.eclipse.org/org/documents/epl-v10.php or\n+# http://opensource.org/licenses/eclipse-1.0.php\n+\n+import os\n+from server_common.utilities import print_and_log, compress_and_hex\n+from BlockServer.core.file_path_manager import FILEPATH_MANAGER\n+from BlockServer.fileIO.schema_checker import ConfigurationSchemaChecker\n+from xml.dom import minidom\n+\n+GET_SCREENS = \"GET_SCREENS\"\n+SET_SCREENS = \"SET_SCREENS\"\n+\n+SCREENS_FILE = \"screens.xml\"\n+SCREENS_SCHEMA = \"screens.xsd\"\n+\n+\n+class DevicesManager(object):\n+    \"\"\"Class for managing the PVs associated with devices\"\"\"\n+    def __init__(self, block_server, cas, schema_folder, vc_manager):\n+        \"\"\"Constructor.\n+\n+        Args:\n+            block_server (BlockServer): A reference to the BlockServer instance.\n+            cas (CAServer): The channel access server for creating PVs on-the-fly\n+            schema_folder (string): The filepath for the devices schema\n+            vc_manager (ConfigVersionControl): The manager to allow version control modifications\n+        \"\"\"\n+        self._schema_folder = schema_folder\n+        self._cas = cas\n+        self._devices_pvs = dict()\n+        self._vc = vc_manager\n+        self._bs = block_server\n+        self._current_config = \"\"\n+\n+    def load_current(self):\n+        \"\"\"Create the PVs for all the devices found in the devices directory.\"\"\"\n+        devices_file_name = self.get_devices_filename()","path":"BlockServer/core/devices_manager.py","position":50,"original_position":50,"commit_id":"c2c42b9c6f91cc0708477633ec7d74a2711e80a2","original_commit_id":"c2c42b9c6f91cc0708477633ec7d74a2711e80a2","user":{"login":"John-Holt-Tessella","id":7570055,"avatar_url":"https://avatars.githubusercontent.com/u/7570055?v=3","gravatar_id":"","url":"https://api.github.com/users/John-Holt-Tessella","html_url":"https://github.com/John-Holt-Tessella","followers_url":"https://api.github.com/users/John-Holt-Tessella/followers","following_url":"https://api.github.com/users/John-Holt-Tessella/following{/other_user}","gists_url":"https://api.github.com/users/John-Holt-Tessella/gists{/gist_id}","starred_url":"https://api.github.com/users/John-Holt-Tessella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/John-Holt-Tessella/subscriptions","organizations_url":"https://api.github.com/users/John-Holt-Tessella/orgs","repos_url":"https://api.github.com/users/John-Holt-Tessella/repos","events_url":"https://api.github.com/users/John-Holt-Tessella/events{/privacy}","received_events_url":"https://api.github.com/users/John-Holt-Tessella/received_events","type":"User","site_admin":false},"body":"I think that if the file doesn't exist this returns blank and an exception will be thrown and caught about a file with no file name does not exist","created_at":"2016-05-19T08:37:41Z","updated_at":"2016-05-19T08:37:41Z","html_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45#discussion_r63841072","pull_request_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/comments/63841072"},"html":{"href":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45#discussion_r63841072"},"pull_request":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45","id":69682106,"html_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45","diff_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45.diff","patch_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45.patch","issue_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/45","number":45,"state":"open","locked":false,"title":"Opi hackathon block server","user":{"login":"AdrianPotter","id":10273443,"avatar_url":"https://avatars.githubusercontent.com/u/10273443?v=3","gravatar_id":"","url":"https://api.github.com/users/AdrianPotter","html_url":"https://github.com/AdrianPotter","followers_url":"https://api.github.com/users/AdrianPotter/followers","following_url":"https://api.github.com/users/AdrianPotter/following{/other_user}","gists_url":"https://api.github.com/users/AdrianPotter/gists{/gist_id}","starred_url":"https://api.github.com/users/AdrianPotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdrianPotter/subscriptions","organizations_url":"https://api.github.com/users/AdrianPotter/orgs","repos_url":"https://api.github.com/users/AdrianPotter/repos","events_url":"https://api.github.com/users/AdrianPotter/events{/privacy}","received_events_url":"https://api.github.com/users/AdrianPotter/received_events","type":"User","site_admin":false},"body":"ISISComputingGroup/IBEX/issues/1129","created_at":"2016-05-11T14:29:57Z","updated_at":"2016-05-19T08:37:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0daf0d2b395a85f630ba35dce2d96fea62584a7","assignee":{"login":"mattclarke","id":3032495,"avatar_url":"https://avatars.githubusercontent.com/u/3032495?v=3","gravatar_id":"","url":"https://api.github.com/users/mattclarke","html_url":"https://github.com/mattclarke","followers_url":"https://api.github.com/users/mattclarke/followers","following_url":"https://api.github.com/users/mattclarke/following{/other_user}","gists_url":"https://api.github.com/users/mattclarke/gists{/gist_id}","starred_url":"https://api.github.com/users/mattclarke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattclarke/subscriptions","organizations_url":"https://api.github.com/users/mattclarke/orgs","repos_url":"https://api.github.com/users/mattclarke/repos","events_url":"https://api.github.com/users/mattclarke/events{/privacy}","received_events_url":"https://api.github.com/users/mattclarke/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45/commits","review_comments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45/comments","review_comment_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/45/comments","statuses_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/statuses/c2c42b9c6f91cc0708477633ec7d74a2711e80a2","head":{"label":"ISISComputingGroup:opi_hackathon_block_server","ref":"opi_hackathon_block_server","sha":"c2c42b9c6f91cc0708477633ec7d74a2711e80a2","user":{"login":"ISISComputingGroup","id":7941980,"avatar_url":"https://avatars.githubusercontent.com/u/7941980?v=3","gravatar_id":"","url":"https://api.github.com/users/ISISComputingGroup","html_url":"https://github.com/ISISComputingGroup","followers_url":"https://api.github.com/users/ISISComputingGroup/followers","following_url":"https://api.github.com/users/ISISComputingGroup/following{/other_user}","gists_url":"https://api.github.com/users/ISISComputingGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ISISComputingGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISISComputingGroup/subscriptions","organizations_url":"https://api.github.com/users/ISISComputingGroup/orgs","repos_url":"https://api.github.com/users/ISISComputingGroup/repos","events_url":"https://api.github.com/users/ISISComputingGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ISISComputingGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":40836703,"name":"EPICS-inst_servers","full_name":"ISISComputingGroup/EPICS-inst_servers","owner":{"login":"ISISComputingGroup","id":7941980,"avatar_url":"https://avatars.githubusercontent.com/u/7941980?v=3","gravatar_id":"","url":"https://api.github.com/users/ISISComputingGroup","html_url":"https://github.com/ISISComputingGroup","followers_url":"https://api.github.com/users/ISISComputingGroup/followers","following_url":"https://api.github.com/users/ISISComputingGroup/following{/other_user}","gists_url":"https://api.github.com/users/ISISComputingGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ISISComputingGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISISComputingGroup/subscriptions","organizations_url":"https://api.github.com/users/ISISComputingGroup/orgs","repos_url":"https://api.github.com/users/ISISComputingGroup/repos","events_url":"https://api.github.com/users/ISISComputingGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ISISComputingGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers","description":null,"fork":false,"url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers","forks_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/forks","keys_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/teams","hooks_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/hooks","issue_events_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/events{/number}","events_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/events","assignees_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/assignees{/user}","branches_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/branches{/branch}","tags_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/tags","blobs_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/statuses/{sha}","languages_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/languages","stargazers_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/stargazers","contributors_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/contributors","subscribers_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/subscribers","subscription_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/subscription","commits_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/contents/{+path}","compare_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/merges","archive_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/downloads","issues_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues{/number}","pulls_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls{/number}","milestones_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/milestones{/number}","notifications_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/labels{/name}","releases_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/releases{/id}","deployments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/deployments","created_at":"2015-08-16T19:48:23Z","updated_at":"2016-01-13T09:47:10Z","pushed_at":"2016-05-16T14:28:05Z","git_url":"git://github.com/ISISComputingGroup/EPICS-inst_servers.git","ssh_url":"git@github.com:ISISComputingGroup/EPICS-inst_servers.git","clone_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers.git","svn_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers","homepage":null,"size":1067,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ISISComputingGroup:master","ref":"master","sha":"6442b9f5778db0bc129573c196a3af55728d3d03","user":{"login":"ISISComputingGroup","id":7941980,"avatar_url":"https://avatars.githubusercontent.com/u/7941980?v=3","gravatar_id":"","url":"https://api.github.com/users/ISISComputingGroup","html_url":"https://github.com/ISISComputingGroup","followers_url":"https://api.github.com/users/ISISComputingGroup/followers","following_url":"https://api.github.com/users/ISISComputingGroup/following{/other_user}","gists_url":"https://api.github.com/users/ISISComputingGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ISISComputingGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISISComputingGroup/subscriptions","organizations_url":"https://api.github.com/users/ISISComputingGroup/orgs","repos_url":"https://api.github.com/users/ISISComputingGroup/repos","events_url":"https://api.github.com/users/ISISComputingGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ISISComputingGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":40836703,"name":"EPICS-inst_servers","full_name":"ISISComputingGroup/EPICS-inst_servers","owner":{"login":"ISISComputingGroup","id":7941980,"avatar_url":"https://avatars.githubusercontent.com/u/7941980?v=3","gravatar_id":"","url":"https://api.github.com/users/ISISComputingGroup","html_url":"https://github.com/ISISComputingGroup","followers_url":"https://api.github.com/users/ISISComputingGroup/followers","following_url":"https://api.github.com/users/ISISComputingGroup/following{/other_user}","gists_url":"https://api.github.com/users/ISISComputingGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ISISComputingGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISISComputingGroup/subscriptions","organizations_url":"https://api.github.com/users/ISISComputingGroup/orgs","repos_url":"https://api.github.com/users/ISISComputingGroup/repos","events_url":"https://api.github.com/users/ISISComputingGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ISISComputingGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers","description":null,"fork":false,"url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers","forks_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/forks","keys_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/teams","hooks_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/hooks","issue_events_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/events{/number}","events_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/events","assignees_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/assignees{/user}","branches_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/branches{/branch}","tags_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/tags","blobs_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/statuses/{sha}","languages_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/languages","stargazers_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/stargazers","contributors_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/contributors","subscribers_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/subscribers","subscription_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/subscription","commits_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/contents/{+path}","compare_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/merges","archive_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/downloads","issues_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues{/number}","pulls_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls{/number}","milestones_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/milestones{/number}","notifications_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/labels{/name}","releases_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/releases{/id}","deployments_url":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/deployments","created_at":"2015-08-16T19:48:23Z","updated_at":"2016-01-13T09:47:10Z","pushed_at":"2016-05-16T14:28:05Z","git_url":"git://github.com/ISISComputingGroup/EPICS-inst_servers.git","ssh_url":"git@github.com:ISISComputingGroup/EPICS-inst_servers.git","clone_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers.git","svn_url":"https://github.com/ISISComputingGroup/EPICS-inst_servers","homepage":null,"size":1067,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45"},"html":{"href":"https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/45"},"issue":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/45"},"comments":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/ISISComputingGroup/EPICS-inst_servers/statuses/c2c42b9c6f91cc0708477633ec7d74a2711e80a2"}}}}