Exemplo n.º 1
0
def download_latest_hlebsol():
    from pbs import wget, mv, rm, cp

    wget('-N', '-S', 'http://hleb-sol.biz/templates/1.xls')
    mv('1.xls', 'dinner/fixtures/hlebsol-current.xls')

    wget('-N', '-S', 'http://hleb-sol.biz/templates/2.xls')
    mv('2.xls', 'dinner/fixtures/hlebsol-next.xls')

    cp('dinner/fixtures/hlebsol-current.xls',   'dinner/fixtures/fusion-current.xls')
    cp('dinner/fixtures/hlebsol-next.xls',      'dinner/fixtures/fusion-next.xls')
Exemplo n.º 2
0
def convert(filename, path, output_path):
  base, extension = os.path.splitext(filename)
  extension = extension.lower()
  
  original_full_path = "%s%s" % (path, filename)
  new_full_path = "%s%s.mp3" % (output_path, base)
  infile = clean_path(original_full_path)
  outfile = clean_path(new_full_path)

  if extension == ".mp3":
    
    #determine if we we should re-encode this mp3 to a lower bit rate
    out = mp3info("-x", "-r v",'-p "%r"', infile)
    convert_file = False
    if out == "Variable":
      out = mp3info("-x", "-r m",'-p "%r"', infile)
      if int(out) >= 170:
        convert_file = True
    else:
      if int(out) >= 128:
        convert_file = True
        
    if convert_file:


      lame("--preset fast medium", "--mp3input", infile, outfile)

      #update tags
      original_info = mutagen.File(original_full_path, easy=True)
      new_info = mutagen.File(new_full_path, easy=True)
      set_info(original_info, new_info)

    else:
      cp(infile, outfile)
  elif extension == ".flac":

    lame(flac('-c', '-d', infile), "--preset fast medium",  '-', outfile)
    #update tags
    original_info = mutagen.File(original_full_path, easy=True)
    new_info = mutagen.File(new_full_path, easy=True)
    set_info(original_info, new_info)

  elif extension == ".ogg":
    #grab ogg info
    lame(oggdec('-r', infile), "--preset fast medium", '-r', '-', outfile)

    #update tags
    original_info = mutagen.File(original_full_path, easy=True)
    new_info = mutagen.File(new_full_path, easy=True)
    set_info(original_info, new_info)
Exemplo n.º 3
0
#!/usr/bin/env python

import MoinMoin
from os.path import join, realpath, dirname
from pbs import cp

root_dir = dirname(realpath(__file__))
moin_dir = dirname(MoinMoin.__file__)

cp(join(root_dir, 'bootstrap.py'), join(moin_dir, 'theme'))
cp('-r', join(root_dir, 'bootstrap'), join(moin_dir, 'web/static/htdocs'))