示例#1
0
 def test_non_executable(self):
     f, name = tempfile.mkstemp()
     try:
         self.log('temp filename: %s', name)
         self.assertFalse(mergetools.check_availability(name))
     finally:
         os.close(f)
         os.unlink(name)
示例#2
0
 def test_non_executable(self):
     f, name = tempfile.mkstemp()
     try:
         self.log('temp filename: %s', name)
         self.assertFalse(mergetools.check_availability(name))
     finally:
         os.close(f)
         os.unlink(name)
示例#3
0
文件: conflicts.py 项目: biji/qbzr
 def is_merge_tool_launchable(self):
     if mergetools is None:
         return False, gettext(
             "Bazaar 2.4 or later is required for external mergetools support"
         )
     items = self.conflicts_list.selectedItems()
     error_msg = ""
     enabled = True
     if len(items) != 1 or items[0].data(
             1, QtCore.Qt.UserRole).toString() != "text conflict":
         enabled = False
     config = GlobalConfig()
     tool = unicode(self.merge_tools_combo.currentText())
     cmdline = config.find_merge_tool(tool)
     if cmdline is None:
         error_msg = gettext(
             "Set up external_merge app in qconfig under the Merge tab")
         enabled = False
     elif not mergetools.check_availability(cmdline):
         enabled = False
         error_msg = gettext("External merge tool %(tool)s is not available") % \
                 { 'tool': tool }
     return enabled, error_msg
示例#4
0
 def test_nonexistent(self):
     self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))
示例#5
0
 def test_exe_on_path(self):
     self.assertTrue(mergetools.check_availability('python'))
示例#6
0
 def test_full_path(self):
     self.assertTrue(mergetools.check_availability(sys.executable))
示例#7
0
 def test_nonexistent(self):
     self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))
示例#8
0
 def test_exe_on_path(self):
     self.assertTrue(mergetools.check_availability('python'))
示例#9
0
 def test_full_path(self):
     self.assertTrue(mergetools.check_availability(sys.executable))