===== GUI Class ===== The GUI class enables you to create dialog and other UI related operations. This page will assume you created an instance using //gui=Gui()// ==== Popup dialog ===== __gui.displayError(str type,str message)__ Popup an error message dialog. Type and message are strings, you can put whetever you want. gui.displayError("File error","This file does not exist") __gui.displayInfo(str type,str message)__ Popup an info message dialog. Type and message are strings, you can put whetever you want. gui.displayInfo("Encoding","Encoding done") ==== Selecting files and folders ===== __gui.dirSelect(str title)__ Open the file selector to select a folder. The selected path is returned. Title is the title of the file selector. folder=gui.dirSelect("Select the source folder") __gui.fileReadSelect(str title)__ Open the file selector to open a file in read mode. __gui.fileWriteSelect(str title)__ Open the file selector to open a file in write mode. If the file already exists, you'll be prompted to overwrite it. ==== Scanning folders ===== __get_folder_content(folder,ext)__ Return a list of file in folder 'folder" with extension 'ext'. For exampl e: lst=get_folder_content("/home/foo/videos","avi") will return all .avi files in the folder /home/foo/videos. Beware this is a function, not attached to gui or adm. ==== Manipulating paths ===== __dirname(path)__ Return the dir that leads to path dirname("/c/foo/bar.txt")=>"/c/foo" __basename(path)__ Return the filename only basename("/c/foo/bar.txt")=>"bar.txt" ==== Getting a file size ===== __get_file_size(file)__ Return the size of the file 'file" ---- [[using:tinypy|Go back to tinypy]]