~ubuntu-branches/ubuntu/raring/hplip/raring

« back to all changes in this revision

Viewing changes to prnt/cups.py

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-12-23 11:04:31 UTC
  • mfrom: (2.1.158 natty)
  • Revision ID: james.westby@ubuntu.com-20101223110431-ev5wz1it6b7jce51
Tags: 3.10.9-1
New Upstream Release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
 
203
203
def getAllowableMIMETypes():
204
204
    """
205
 
        Scan all /etc/cups/*.convs files for allowable file formats.
 
205
        Scan all /etc/cups/*.convs and /usr/share/cups/mime 
 
206
        files for allowable file formats.
206
207
    """
207
 
    files = glob.glob("/etc/cups/*.convs")
208
 
 
 
208
    paths = []
209
209
    allowable_mime_types = []
210
 
 
 
210
    files = []
 
211
    if os.path.exists("/etc/cups"):
 
212
        paths.append("/etc/cups/*.convs")
 
213
    if os.path.exists("/usr/share/cups/mime"):
 
214
        paths.append("/usr/share/cups/mime/*.convs")
 
215
    for path in paths:
 
216
        files.extend(glob.glob(path))
211
217
    for f in files:
212
218
        #log.debug( "Capturing allowable MIME types from: %s" % f )
213
219
        conv_file = file(f, 'r')