def doConnect(): global ssmConn ssmConn = vsapi.ResourceAccess()
# as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import vsapi # Connect to the SSM ra = vsapi.ResourceAccess() # Allocate a GPU and a Server on the same node alloc = ra.allocate([[vsapi.GPU(), vsapi.Server()]]) res = alloc.getResources() gpu = res[0][0] srv = res[0][1] screen = vsapi.Screen(0) # Setup the X screen if gpu.getAllowNoScanOut(): gpu.clearScanouts() screen.setFBProperty('resolution', [1280, 1024]) else: if len(gpu.getScanouts()) == 0: