示例#1
0
def create_printable_file(src, instrument, piece):
    file_name = reCamelCase(piece.title) + '_' + instrument + '.pdf'
    dst = osjoin(piece.path, PizzicatoPreferences.PRINTABLES_FOLDER, file_name)
    print(src)
    print(dst)
    shutil.copyfile(src, dst)
    return dst
示例#2
0
def create_new_piece_folders(band, name):
    dst = osjoin(band.path, PizzicatoPreferences.FINALS_FOLDER,
                 reCamelCase(name))
    os.makedirs(dst)
    os.makedirs(osjoin(dst, PizzicatoPreferences.AUDIOS_FOLDER))
    os.makedirs(osjoin(dst, PizzicatoPreferences.PRINTABLES_FOLDER))
    os.makedirs(osjoin(dst, PizzicatoPreferences.EDITABLES_FOLDER))
    return dst
示例#3
0
def rename_piece(piece, name):
    band_path = piece.band.path
    name_formated = reCamelCase(name)
    for printable_file in piece.get_printable_files():
        printable_file.rename(name)
    src = piece.path
    dst = osjoin(band_path, PizzicatoPreferences.FINALS_FOLDER, name_formated)
    os.rename(src, dst)
    return dst
示例#4
0
def create_audio_file_path(instrument, piece):
    return osjoin(piece.path, PizzicatoPreferences.EDITABLES_FOLDER,
                  reCamelCase(piece.title) + '_' + instrument + '.pdf')
示例#5
0
def rename_printable_file(printable_file, new_name):
    name_formated = reCamelCase(new_name)
    file_new_name = name_formated + '_' + printable_file.file.split('_')[-1]
    src = printable_file.path
    dst = osjoin(ossplit(src)[0], file_new_name)
    os.rename(src, dst)
示例#6
0
def rename_band(band, name):
    src = band.path
    dst = osjoin(os.path.dirname(src), reCamelCase(name))
    os.rename(src, dst)
    return dst
示例#7
0
def create_new_band_folders(working_path, name):
    dst = osjoin(working_path, reCamelCase(name))
    os.makedirs(dst)
    os.makedirs(osjoin(dst, PizzicatoPreferences.FINALS_FOLDER))
    os.makedirs(osjoin(dst, PizzicatoPreferences.WIP_FOLDER))
    return dst
示例#8
0
 def create_piece(band, name):
     create_new_piece_folders(band, name)
     folder = reCamelCase(name)
     piece = band.add_piece(folder)
     for pieces_model in PizzicatoController.pieces_models:
         pieces_model.add_piece(piece)