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

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

src/g/r/gramps-3.4.2/src/gui/editors/editmediaref.py   Gramps(Download)
        if path != self.source.get_path() and path_full != self.source.get_path():
            #redetermine mime
            mime = gen.mime.get_type(Utils.find_file(path_full))
            self.source.set_mime_type(mime)
            descr = gen.mime.get_description(mime)

src/g/r/gramps-3.4.2/src/gui/editors/editmedia.py   Gramps(Download)
        if path != self.obj.get_path() and path_full != self.obj.get_path():
            #redetermine mime
            mime = gen.mime.get_type(Utils.find_file(path_full))
            self.obj.set_mime_type(mime)
            descr = gen.mime.get_description(mime)

src/g/r/gramps-3.4.2/src/gui/editors/displaytabs/gallerytab.py   Gramps(Download)
                        name = unicode(urllib.url2pathname(
                                    name.encode(sys.getfilesystemencoding())))
                        mime = gen.mime.get_type(name)
                        if not gen.mime.is_valid_type(mime):
                            return

src/g/r/gramps-3.4.2/src/plugins/view/mediaview.py   Gramps(Download)
                name = unicode(urllib.url2pathname(
                                mfile.encode(sys.getfilesystemencoding())))
                mime = gen.mime.get_type(name)
                if not gen.mime.is_valid_type(mime):
                    return

src/g/r/gramps-3.4.2/src/plugins/tool/MediaManager.py   Gramps(Download)
                    if media_full_path not in self.path_list:
                        self.path_list.append(media_full_path)
                        mime_type = gen.mime.get_type(media_full_path)
                        if gen.mime.is_image_type(mime_type):
                            obj = MediaObject()

src/g/r/gramps-3.4.2/src/plugins/lib/libgedcom.py   Gramps(Download)
 
        state.media.set_path(path)
        state.media.set_mime_type(gen.mime.get_type(path))
        if not state.media.get_description():
            state.media.set_description(path)
                full_path = os.path.abspath(path)
                if os.path.isfile(full_path):
                    photo.set_mime_type(gen.mime.get_type(full_path))
                else:
                    photo.set_mime_type(MIME_MAP.get(form.lower(), 'unknown'))

src/g/r/gramps-3.4.2/src/gui/editors/addmedia.py   Gramps(Download)
 
 
        mtype = gen.mime.get_type(full_file)
        description = description or os.path.basename(filename)
 
        filename = Utils.find_file( filename)
        if filename:
            mtype = gen.mime.get_type(filename)
            if mtype and mtype.startswith("image"):
                image = scale_image(filename, const.THUMBSCALE)

src/g/r/gramps-3.4.2/src/plugins/import/ImportXml.py   Gramps(Download)
                attr.set_value(attrs[key])
                self.photo.add_attribute(attr)
        self.photo.set_mime_type(gen.mime.get_type(self.photo.get_path()))
        self.db.add_object(self.photo, self.trans)
        #set correct change time