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

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

        def get_mp3tag(fn=None, fp=None):
  if not fn and not fp:
    return {}
  if fn and os.stat(fn)[6] == 0:
    return {}

  try:
    if not fp:
      fp = open(fn)
  except IOError, reason:
    return {}

  try:
    fp.seek(-128, 2)
  except IOError, reason:
    return {}

  line = None
  while 1:
    l = fp.readline()
    if not l: break
    line = l

  id = {}
  if line[:3] == 'TAG':
    v1 = 1
    i = 0; j = i + 3
    #id['d1'] = string.strip(line[i:j])
    i = j; j = i + 30
    id['TITLE'] = string.strip(line[i:j])
    i = j; j = i + 30
    id['ARTIST'] = string.strip(line[i:j])
    i = j; j = i + 30
    id['ALBUM'] = string.strip(line[i:j])
    i = j; j = i + 4
    id['YEAR'] = string.strip(line[i:j])
    i = j; j = i + 28
    id['COMMENT'] = string.strip(line[i:j])

    genre = ord(line[-1])
    try:
      id['GENRE'] = winamp_genres[ord(line[-1])]
    except IndexError:
      id['GENRE'] = "Unknown"


  return id
        


src/m/u/music-share-HEAD/lib/__init__.py   music-share(Download)
def get_mp3_info(file):
	file.seek(0)
	info = mp3.mp3info(fp=file)
	file.seek(0)
	info.update(mp3.get_mp3tag(fp=file))