Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Generates a list of file filters
@return: list of all file filters based on extension associations

        def GenFileFilters():
    """Generates a list of file filters
    @return: list of all file filters based on extension associations

    """
    extreg = ExtensionRegister()
    # Convert extension list into a formatted string
    f_dict = dict()
    for key, val in extreg.iteritems():
        val.sort()
        if key.lower() == 'makefile':
            continue

        f_dict[key] = u";*." + u";*.".join(val)

    # Build the final list of properly formatted strings
    filters = list()
    for key in f_dict:
        tmp = u" (%s)|%s|" % (f_dict[key][1:], f_dict[key][1:])
        filters.append(key + tmp)
    filters.sort(key=unicode.lower)
    filters.insert(0, u"All Files (*)|*|")
    filters[-1] = filters[-1][:-1] # IMPORTANT trim last '|' from item in list
    return filters
        


src/e/i/einstein-HEAD/Python25Einstein/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/ed_main.py   einstein(Download)
        if e_id == ID_OPEN:
            dlg = wx.FileDialog(self, _("Choose a File"), '', "", 
                                ''.join(syntax.GenFileFilters()), 
                                wx.OPEN | wx.MULTIPLE)
            dlg.SetFilterIndex(_PGET('FFILTER', 'int', 0))
        dlg = wx.FileDialog(self, _("Choose a Save Location"), u'', 
                            title.lstrip(u"*"), 
                            ''.join(syntax.GenFileFilters()), 
                            wx.SAVE | wx.OVERWRITE_PROMPT)
 

src/e/d/Editra-0.7.20/src/ed_main.py   Editra(Download)
 
            dlg = wx.FileDialog(self, _("Editra: Open"), fdir, "",
                                ''.join(syntax.GenFileFilters()),
                                wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR)
            dlg.SetFilterIndex(_PGET('FFILTER', 'int', 0))
                            os.path.dirname(sdir),
                            title.lstrip(u"*"),
                            u''.join(syntax.GenFileFilters()),
                            wx.SAVE | wx.OVERWRITE_PROMPT)
 

src/e/d/Editra-0.7.20/tests/unittests/testSyntaxFunctions.py   Editra(Download)
    def testGenFileFilters(self):
        """Test getting the file filter list"""
        filters = syntax.GenFileFilters()
        self.assertTrue(isinstance(filters, list))
        for f in filters: