~ubuntu-branches/ubuntu/oneiric/phatch/oneiric

« back to all changes in this revision

Viewing changes to phatch/pyWx/lib/wildcard.py

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2008-02-13 23:48:47 UTC
  • Revision ID: james.westby@ubuntu.com-20080213234847-mp6vc4y88a9rz5qz
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2007-2008 www.stani.be
 
2
#
 
3
# This program is free software: you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation, either version 3 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program.  If not, see http://www.gnu.org/licenses/
 
15
 
 
16
#---wildcard
 
17
def wildcard_list(name,extensions):
 
18
    return '%s|%s'%(name,
 
19
        ';'.join([_wildcard_extension(ext) for ext in extensions]))
 
20
        
 
21
def _wildcard_extension(ext):
 
22
    return '*.%s;*.%s;*.%s'%(ext,ext.upper(),ext.capitalize()) 
 
23