Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (78)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (12275)

  • Button "Clean FFMeta" does nothing after compiling with PyInstaller

    6 mai, par Leonie Holdermann

    I’m working on my first Python project and I’ve compiled it into an executable using PyInstaller with the following command :

    


    pyinstaller --onefile --noconsole app.py


    


    However, when I run the executable, the button "Clean FFMeta" which triggers the clean_ffmeta() function does nothing. Additionally, changing the language or the chapter settings under the "Options -> Chapter settings" menu doesn’t seem to affect anything either. It all works perfectly in the Python script before compilation, but once compiled into an .exe, none of these functions respond.

    


    I've reviewed the code, and the button is correctly linked to the function, but I suspect something might be going wrong during the compilation process.

    


    What I have tried :

    


      

    • Checked that all dependencies are included.
    • 


    • Verified that the configuration and language changes are being correctly applied before compilation.
    • 


    • Tried running the executable from a console to check for error messages, but there are none visible (since I used —noconsole).
    • 


    


    What I expect :

    


      

    • The "Clean FFMeta" button should clean the FFMeta file based on the
user settings.
    • 


    • Language and chapter settings should be updated and reflected in the GUI immediately.
    • 


    


    Code :
Below is a simplified version of my code, especially the sections related to the "Clean FFMeta" functionality and language/chapter settings.

    


    def clean_ffmeta():
if not config.get("cd_in_path"):
    show_error(texts[current_language]["error"] + " No CD_IN path configured.")
    return

chapter_path = os.path.join(config["cd_in_path"], "chapters.ffmeta")
cleaned_chapter_path = os.path.join(config["cd_in_path"], "chapters_cleaned.ffmeta")

if not os.path.exists(chapter_path):
    show_error(texts[current_language]["no_chapters_file"])
    return

write_to_console("Starting to clean FFMeta...")
thread = threading.Thread(target=clean_ffmeta_thread, args=(chapter_path, cleaned_chapter_path))
thread.start()

def clean_ffmeta_thread(chapter_path, cleaned_chapter_path):
    try:
        chapter_action = config.get("chapter_action", "clean")
        keep_empty = config.get("chapter_keep_empty", False)

        write_to_console(f"Chapter action: {chapter_action}, Keep empty: {keep_empty}")

        with open(chapter_path, "r", encoding="utf-8") as f:
            lines = f.readlines()

        new_lines = []
        chapter_counter = 0

        for line in lines:
            stripped_line = line.strip()
            if stripped_line.startswith("title="):
                title_content = stripped_line[6:]
                
                if chapter_action == "clean":
                    if title_content == "":
                        if keep_empty:
                            new_lines.append(line)
                        else:
                            write_to_console("Empty title skipped.")
                            continue
                    else:
                        new_lines.append(line)
                
                elif chapter_action == "number":
                    chapter_counter += 1
                    chapter_title = f"{texts[current_language]['chapter']} {chapter_counter}"
                    new_lines.append(f"title={chapter_title}\n")
                    write_to_console(f"Renamed to: {chapter_title}")
            else:
                new_lines.append(line)

        with open(cleaned_chapter_path, "w", encoding="utf-8") as f:
            f.writelines(new_lines)

        write_to_console(f"FFMeta cleaned and saved as '{cleaned_chapter_path}'.")

    except Exception as e:
        write_to_console(f"Error cleaning FFMeta: {str(e)}")

def open_chapter_settings():
    global chapter_settings_window, chapter_action_var
    global chapter_keep_empty_checkbox, chapter_save_button

    chapter_settings_window = tk.Toplevel(root)
    chapter_settings_window.title(texts[current_language]["chapter_setting_title"])
    chapter_settings_window.geometry("300x250")
    chapter_settings_window.resizable(False, False)
    
    chapter_action_var = tk.StringVar(value=config.get("chapter_action", "clean"))
    chapter_keep_empty_var = tk.BooleanVar(value=config.get("chapter_keep_empty", False))
    
    tk.Label(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_choose_option"]
    ).pack(pady=(10, 5))
    
    tk.Radiobutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_clean"],
        variable=chapter_action_var,
        value="clean"
    ).pack(pady=5)

    tk.Radiobutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_number"],
        variable=chapter_action_var,
        value="number"
    ).pack(pady=5)

    chapter_keep_empty_checkbox = tk.Checkbutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_keep_empty"],
        variable=chapter_keep_empty_var
    )
    chapter_keep_empty_checkbox.pack(pady=5)

    chapter_save_button = tk.Button(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_save"],
        command=lambda: save_chapter_settings(chapter_keep_empty_var, chapter_settings_window)
    )
    chapter_save_button.pack(pady=10)

def save_chapter_settings(keep_empty_var, window):
    config["chapter_action"] = chapter_action_var.get()
    config["chapter_keep_empty"] = keep_empty_var.get()
    save_config()
    write_to_console(f"Chapter settings saved: Action={config['chapter_action']}, Keep empty={config['chapter_keep_empty']}")
    window.destroy()

options_menu = tk.Menu(menu, tearoff=0)
options_menu.add_command(label="Check pip-ffmpeg", command=check_pip_ffmpeg)
options_menu.add_command(label=texts[current_language]["menu_chapter_settings"], command=open_chapter_settings)
menu.add_cascade(label="Options", menu=options_menu)

btn3 = tk.Button(btn_frame, text="3. Clean FFMeta", command=clean_ffmeta)
btn3.grid(row=0, column=2, padx=5)


    


    Here you find the entire project code of the entire project : https://www.pythonmorsels.com/p/32hkh/

    


    Why is the clean_chapters function not working ?

    


  • Fill patterns

    9 juin 2010, par Mikko Koppanen — Imagick, PHP stuff

    My work life has been quite busy lately and I haven’t had a chance to sit down and blog. I have been touring around London and some parts of the northern England consulting and organizing some training here and there. Luckily I have had the chance to do some work on Imagick and the 2.2.0 beta release is getting closer. The internal structure was completely restructured and broken down into several smaller files. During this time Imagick was adapted to follow the PHP Coding Standards more closely. Still a work in progress :)

    I committed slightly modified version of this example to PHP Manual http://uk.php.net/manual/en/imagick.examples.php page a few days ago. The example illustrates using an image as a part of a named fill pattern. The fill pattern is used to annotate text but the named pattern could also be used to fill any shapes that allow fill to be specified (include circles, ellipses, rectangles, polygons etc etc). The code itself is pretty straight forward : Read the image, create the pattern and use the pattern as a fill.

    The ice formations image is from http://www.photoeverywhere.co.uk/west/winterholiday/slides/iceformations5679.htm.

    1. < ?php
    2.  
    3. /* Create a new imagick object */
    4. $im = new Imagick( ’iceformations5679.JPG’ ) ;
    5.  
    6. /* Create imagickdraw object */
    7. $draw = new ImagickDraw() ;
    8.  
    9. /* Start a new pattern called "ice" */
    10. $draw->pushPattern( ’ice’ , 0 , 0 , 50 , 50 ) ;
    11.  
    12. /* Composite the image on the pattern */
    13. $draw->composite( Imagick: :COMPOSITE_OVER, 0, 0, 50, 50, $im ) ;
    14.  
    15. /* Close the pattern */
    16. $draw->popPattern() ;
    17.  
    18. /* Use the pattern called "ice" as the fill */
    19. $draw->setFillPatternURL( ’#ice’ ) ;
    20.  
    21. /* Set font size to 52 */
    22. $draw->setFontSize( 52 ) ;
    23.  
    24. /* Annotate some text */
    25. $draw->annotation( 5, 50, "Hello World !" ) ;
    26.  
    27. /* Create a new canvas and white image */
    28. $canvas = new Imagick() ;
    29. $canvas->newImage( 310, 70, "white" ) ;
    30.  
    31. /* Add black border around the resulting image */
    32. $canvas->borderImage( ’black’, 1, 1 ) ;
    33.  
    34. /* Draw the ImagickDraw on to the canvas */
    35. $canvas->drawImage( $draw ) ;
    36.  
    37. /* Set the format to PNG */
    38. $canvas->setImageFormat( ’png’ ) ;
    39.  
    40. /* Output the image */
    41. header( "Content-Type : image/png" ) ;
    42. echo $canvas ;
    43.  ?>

    And the result is here :

  • Revision 39074 : Ne pas modifier la session trop souvent (plusieurs appels sur une même ...

    28 juin 2010, par kent1@… — Log

    Ne pas modifier la session trop souvent (plusieurs appels sur une même page lorsque plusieurs inclure) donc on attend 5 seconde pour modifier la session