예제 #1
0
파일: tasks.py 프로젝트: KAMI911/zamboni
def approve_rereview(theme):
    """Replace original theme with pending theme on filesystem."""
    # If reuploaded theme, replace old theme design.
    storage = LocalFileStorage()
    rereview = theme.rereviewqueuetheme_set.all()
    reupload = rereview[0]

    if reupload.header_path != reupload.theme.header_path:
        move_stored_file(reupload.header_path,
                         reupload.theme.header_path,
                         storage=storage)
    if reupload.footer_path != reupload.theme.footer_path:
        move_stored_file(reupload.footer_path,
                         reupload.theme.footer_path,
                         storage=storage)
    create_persona_preview_images(
        src=reupload.theme.header_path,
        full_dst=[
            reupload.theme.header_path.replace('header', 'preview'),
            reupload.theme.header_path.replace('header', 'icon')
        ],
        set_modified_on=[reupload.theme.addon])
    rereview.delete()

    theme.addon.increment_version()
예제 #2
0
파일: tasks.py 프로젝트: vinu76jsr/zamboni
def approve_rereview(theme):
    """Replace original theme with pending theme on filesystem."""
    # If reuploaded theme, replace old theme design.
    storage = LocalFileStorage()
    rereview = theme.rereviewqueuetheme_set.all()
    reupload = rereview[0]

    if reupload.header_path != reupload.theme.header_path:
        create_persona_preview_images(
            src=reupload.header_path,
            full_dst=[reupload.theme.thumb_path, reupload.theme.icon_path],
            set_modified_on=[reupload.theme.addon])

        if not reupload.theme.is_new():
            # Legacy themes also need a preview_large.jpg.
            # Modern themes use preview.png for both thumb and preview so there
            # is no problem there.
            copy_stored_file(reupload.theme.thumb_path,
                             reupload.theme.preview_path,
                             storage=storage)

        move_stored_file(reupload.header_path,
                         reupload.theme.header_path,
                         storage=storage)
    if reupload.footer_path != reupload.theme.footer_path:
        move_stored_file(reupload.footer_path,
                         reupload.theme.footer_path,
                         storage=storage)
    rereview.delete()

    theme.addon.increment_version()
예제 #3
0
파일: tasks.py 프로젝트: aricha/zamboni
def approve_rereview(theme):
    """Replace original theme with pending theme on filesystem."""
    # If reuploaded theme, replace old theme design.
    storage = LocalFileStorage()
    rereview = theme.rereviewqueuetheme_set.all()
    reupload = rereview[0]

    if reupload.header_path != reupload.theme.header_path:
        create_persona_preview_images(
            src=reupload.header_path,
            full_dst=[
                reupload.theme.thumb_path,
                reupload.theme.icon_path],
            set_modified_on=[reupload.theme.addon])

        if not reupload.theme.is_new():
            # Legacy themes also need a preview_large.jpg.
            # Modern themes use preview.png for both thumb and preview so there
            # is no problem there.
            copy_stored_file(reupload.theme.thumb_path,
                             reupload.theme.preview_path, storage=storage)

        move_stored_file(
            reupload.header_path, reupload.theme.header_path,
            storage=storage)
    if reupload.footer_path != reupload.theme.footer_path:
        move_stored_file(
            reupload.footer_path, reupload.theme.footer_path,
            storage=storage)
    rereview.delete()

    theme.addon.increment_version()
예제 #4
0
파일: tasks.py 프로젝트: wraithan/zamboni
def approve_rereview(theme):
    """Replace original theme with pending theme on filesystem."""
    # If reuploaded theme, replace old theme design.
    storage = LocalFileStorage()
    rereview = theme.rereviewqueuetheme_set.all()
    reupload = rereview[0]

    move_stored_file(
        reupload.header_path, reupload.theme.header_path,
        storage=storage)
    move_stored_file(
        reupload.footer_path, reupload.theme.footer_path,
        storage=storage)
    create_persona_preview_images(
        src=reupload.theme.header_path,
        full_dst=[
            reupload.theme.header_path.replace('header', 'preview'),
            reupload.theme.header_path.replace('header', 'icon')],
        set_modified_on=[reupload.theme.addon])
    rereview.delete()