def load_scmclients(options): global SCMCLIENTS from rbtools.clients.svn import SVNClient from rbtools.clients.piccolo import PiccoloClient SCMCLIENTS = [ PiccoloClient(options=options), ] tmp_platform = sys.platform if 'java' in tmp_platform.lower(): jv_props = sys.getBaseProperties() #jv_props = dict(jv_props) tmp_platform = jv_props['os.name'] if tmp_platform != 'OpenVMS': # i.e. platform supports subprocess and/or fork SCMCLIENTS.insert(0, SVNClient(options=options)) del tmp_platform
def topspin_location(): """ Gets Topspin home directory. Also serves to check whether the script is being executed from within Topspin or externally. """ try: # topspin >= 3.6 toppath = sys.getBaseProperties()["XWINNMRHOME"] except AttributeError: try: # topspin >= 3.1 and <= 3.5 toppath = sys.registry["XWINNMRHOME"] except (AttributeError, KeyError): # topspin < 3.1 toppath = sys.getEnviron()["XWINNMRHOME"] # if all the above fail, there should be an exception raised and # the function should not return anything return toppath
def __init__(self, create_report): super(OpenFile, self).__init__(GridLayout(6, 1)) self.create_report = create_report self.log1 = JTextField("", 80) self.log2 = JTextField("", 80) #self.log3 = JTextField(str(os.environ.get("VISTA_HOME")).replace("/","\\")+"\scripts\compare_inp\Compare_echo_inp.html",80) #self.log3 = JTextField(str(os.getcwd()).replace("\\bin","\\scripts\\compare_inp")+"\Compare_echo_inp.html",80) if str(sys.getBaseProperties().getProperty('user.home')) != '': self.log3 = JTextField( str(sys.getBaseProperties().getProperty('user.home')) + "\\compare_inp\\", 75) else: self.log3 = JTextField("c:\\compare_inp", 75) self.log4 = JTextField("compare_echo_inp.html", 35) self.log5 = JTextField("Status.........", 80) self.log1.editable = False self.log2.editable = False self.log5.editable = False #logScrollPane = JScrollPane(self.log1) self.fc1 = JFileChooser() self.fc2 = JFileChooser() self.fc3 = JFileChooser() self.fc3.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) self.openButton1 = JButton("Open a File...") self.openButton2 = JButton("Open a File...") self.openButton3 = JButton("Select Directory...") lsnr1 = ButtonListener(self, 1) lsnr2 = ButtonListener(self, 2) lsnr3 = ButtonListener(self, 3) self.openButton1.addActionListener(lsnr1) self.openButton2.addActionListener(lsnr2) self.openButton3.addActionListener(lsnr3) buttonPanel1 = JPanel() buttonPanel1.add(JLabel("Echo File 1: ")) buttonPanel1.add(self.log1) buttonPanel1.add(self.openButton1) buttonPanel2 = JPanel() buttonPanel2.add(JLabel("Echo File 2: ")) buttonPanel2.add(self.log2) buttonPanel2.add(self.openButton2) buttonPanel3 = JPanel() buttonPanel3.add(JLabel("Output Directory: ")) buttonPanel3.add(self.log3) buttonPanel3.add(self.openButton3) textPanel = JPanel() textPanel.add(JLabel("Output File Name: ")) textPanel.add(self.log4) textPanel.add( JLabel( " (Please change filename if you have multiple output HTML files under the same directory.)" )) self.doButton = JButton("Create HTML Report", actionPerformed=self.call_create_report) self.viewButton = JButton("View the Report", actionPerformed=self.view_report) self.exitButton = JButton("Close this Program", actionPerformed=self.exit_app) self.viewButton.setEnabled(0) doPanel = JPanel() doPanel.add(self.doButton) doPanel.add(self.viewButton) doPanel.add(self.exitButton) self.add(buttonPanel1) self.add(buttonPanel2) self.add(buttonPanel3) self.add(textPanel) self.add(doPanel) self.add(self.log5)
def __init__(self,create_report): super(OpenFile, self).__init__(GridLayout(6, 1)) self.create_report = create_report self.log1 = JTextField("",80) self.log2 = JTextField("",80) #self.log3 = JTextField(str(os.environ.get("VISTA_HOME")).replace("/","\\")+"\scripts\compare_inp\Compare_echo_inp.html",80) #self.log3 = JTextField(str(os.getcwd()).replace("\\bin","\\scripts\\compare_inp")+"\Compare_echo_inp.html",80) if str(sys.getBaseProperties().getProperty('user.home'))!='': self.log3 = JTextField(str(sys.getBaseProperties().getProperty('user.home'))+"\\compare_inp\\",75) else: self.log3 = JTextField("c:\\compare_inp",75) self.log4 = JTextField("compare_echo_inp.html",35) self.log5 = JTextField("Status.........",80) self.log1.editable = False self.log2.editable = False self.log5.editable = False #logScrollPane = JScrollPane(self.log1) self.fc1 = JFileChooser() self.fc2 = JFileChooser() self.fc3 = JFileChooser() self.fc3.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) self.openButton1 = JButton("Open a File...") self.openButton2 = JButton("Open a File...") self.openButton3 = JButton("Select Directory...") lsnr1 = ButtonListener(self,1) lsnr2 = ButtonListener(self,2) lsnr3 = ButtonListener(self,3) self.openButton1.addActionListener(lsnr1) self.openButton2.addActionListener(lsnr2) self.openButton3.addActionListener(lsnr3) buttonPanel1 = JPanel() buttonPanel1.add(JLabel("Echo File 1: ")) buttonPanel1.add(self.log1) buttonPanel1.add(self.openButton1) buttonPanel2 = JPanel() buttonPanel2.add(JLabel("Echo File 2: ")) buttonPanel2.add(self.log2) buttonPanel2.add(self.openButton2) buttonPanel3 = JPanel() buttonPanel3.add(JLabel("Output Directory: ")) buttonPanel3.add(self.log3) buttonPanel3.add(self.openButton3) textPanel = JPanel() textPanel.add(JLabel("Output File Name: ")) textPanel.add(self.log4) textPanel.add(JLabel(" (Please change filename if you have multiple output HTML files under the same directory.)")) self.doButton = JButton("Create HTML Report",actionPerformed=self.call_create_report) self.viewButton = JButton("View the Report",actionPerformed=self.view_report) self.exitButton = JButton("Close this Program",actionPerformed=self.exit_app) self.viewButton.setEnabled(0) doPanel = JPanel() doPanel.add(self.doButton) doPanel.add(self.viewButton) doPanel.add(self.exitButton) self.add(buttonPanel1) self.add(buttonPanel2) self.add(buttonPanel3) self.add(textPanel) self.add(doPanel) self.add(self.log5)