def __send_file(self): url = urlparse(self.path) _dir, filename = os.path.split(url.path) localFile = os.path.join(get_resdir(), filename) if not os.path.exists(localFile): self.send_error(404) self.server.log.add('File not found: {}'.format(self.path), Log.WARN) return urlFile = urllib.pathname2url(localFile) self.send_response(200) self.send_header('Content-type', mimetypes.guess_type(urlFile)[0]) self.end_headers() f = open(localFile, 'rb') self.wfile.write(f.read()) f.close()
def load_bitmap(name): filename = get_resdir() + '/' + name + '.png' return wx.Bitmap(filename, wx.BITMAP_TYPE_PNG)
def load_bitmap(name): filename = get_resdir() + "/" + name + ".png" return wx.Bitmap(filename, wx.BITMAP_TYPE_PNG)