Ejemplo n.º 1
0
def getInteractiveActionClasses():
    classes = [ShowMigrationNotes, ShowChangeLogs, ShowVersions, AboutTextTest]
    for fileName in plugins.findDataPaths(["*.txt"], dataDirName="doc"):
        classes.append(
            plugins.Callable(TextFileDisplayDialog,
                             os.path.basename(fileName)))
    return classes
Ejemplo n.º 2
0
 def ensureLocationFileExists(self, fileName, dataDirName=""):
     locationFile = os.path.join(self.location, fileName)
     if not os.path.isfile(locationFile):
         plugins.ensureDirExistsForFile(locationFile)
         plugins.log.info("No file at '" + locationFile + "', copying default file from installation")
         includeSite, includePersonal = self.inputOptions.configPathOptions()
         srcFile = plugins.findDataPaths([fileName], includeSite, includePersonal, dataDirName)[-1]
         shutil.copyfile(srcFile, locationFile)
     return locationFile
Ejemplo n.º 3
0
 def __init__(self, *args):
     guiutils.SubGUI.__init__(self)
     # Do this first, so we set up interceptors and so on early on
     try:
         from storytext import createShortcutBar
         from version_control.custom_widgets_storytext import customEventTypes
         uiMapFiles = plugins.findDataPaths(["*.uimap"], *args)
         self.widget = createShortcutBar(uiMapFiles=uiMapFiles,
                                         customEventTypes=customEventTypes)
         self.widget.show()
     except ImportError:
         self.widget = None
Ejemplo n.º 4
0
 def __init__(self, dynamic, uiManager, actionGUIs, menuNames, *args):
     guiutils.SubGUI.__init__(self)
     # Create GUI manager, and a few default action groups
     self.menuNames = menuNames
     self.dynamic = dynamic
     self.allFiles = plugins.findDataPaths(["*.xml"], *args)
     self.uiManager = uiManager
     self.actionGUIs = actionGUIs
     self.actionGroup = self.uiManager.get_action_groups()[0]
     self.toggleActions = []
     self.loadedModules = set()
     self.diag = logging.getLogger("Menu Bar")
     self.diag.info("All description files : " + pformat(self.allFiles))
Ejemplo n.º 5
0
 def readGtkRCFiles(self, *args):
     for file in plugins.findDataPaths([".gtkrc-2.0*"], *args):
         gtk.rc_parse(file)
Ejemplo n.º 6
0
    fixSysPath(os.path.abspath(__file__))
    from texttestlib import plugins, default
    parser = OptionParser("usage: %prog [options] filter1 filter2 ...")
    parser.add_option("-m",
                      "--module",
                      help="also import module MODULE",
                      metavar="MODULE")
    parser.add_option("-u",
                      "--unordered",
                      action="store_true",
                      help='Use unordered filter instead of standard one')
    parser.add_option("-t",
                      "--testrelpath",
                      help="use test relative path RELPATH",
                      metavar="RELPATH")
    (options, args) = parser.parse_args()
    if options.module:
        exec "import " + options.module
    allPaths = plugins.findDataPaths(["logging.console"],
                                     dataDirName="log",
                                     includePersonal=True)
    plugins.configureLogging(
        allPaths[-1])  # Won't have any effect if we've already got a log file
    if options.unordered:
        runDepFilter = default.rundependent.UnorderedTextFilter(
            args, options.testrelpath)
    else:
        runDepFilter = default.rundependent.RunDependentTextFilter(
            args, options.testrelpath)
    runDepFilter.filterFile(sys.stdin, sys.stdout)