<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to LIB_FOPS</title><link>https://sourceforge.net/p/pirobot/wiki/LIB_FOPS/</link><description>Recent changes to LIB_FOPS</description><atom:link href="https://sourceforge.net/p/pirobot/wiki/LIB_FOPS/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 06 Jan 2025 09:20:45 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pirobot/wiki/LIB_FOPS/feed" rel="self" type="application/rss+xml"/><item><title>LIB_FOPS modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/LIB_FOPS/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lib_fops"&gt;LIB_FOPS&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#getdirnamefileordirname"&gt;getDirName(fileordirname)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#splitextensionfilename"&gt;splitExtension(filename)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#getremovabledirs"&gt;getRemovableDirs()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#getfilelistdirectory-allowedfileendings"&gt;getFileList(directory, allowedFileEndings)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#getdirlistdirectory-ignorehiddendirs"&gt;getDirList(directory, ignoreHiddenDirs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#getalldirsrootdir-ignorehiddendirs"&gt;getAllDirs(rootdir, ignoreHiddenDirs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#getallfilesrootdir-allowedfileendings"&gt;getAllFiles(rootdir, allowedFileEndings)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#joinpath1-path2"&gt;join(path1, path2)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#trymountingdev-mntpoint-retestfalse"&gt;tryMounting(dev, mntpoint, retest=False)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#tryunmountingdev-mntpoint-retestfalse"&gt;tryUnmounting(dev, mntpoint, retest=False)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h1 id="lib_fops"&gt;LIB_FOPS&lt;/h1&gt;
&lt;p&gt;Import from &lt;code&gt;appdata/CodeLibs/LIB_FOPS.py&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This library is for file operations.&lt;/p&gt;
&lt;p&gt;Needs &lt;code&gt;pyudev&lt;/code&gt; and &lt;code&gt;psutil&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="getdirnamefileordirname"&gt;getDirName(fileordirname)&lt;/h2&gt;
&lt;p&gt;Returns the directory path where &lt;code&gt;fileordirname&lt;/code&gt; is in.&lt;br/&gt;
e.g. &lt;code&gt;dir = getDirName("myfile.txt")&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="splitextensionfilename"&gt;splitExtension(filename)&lt;/h2&gt;
&lt;p&gt;Returns the extension of &lt;code&gt;filename&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="getremovabledirs"&gt;getRemovableDirs()&lt;/h2&gt;
&lt;p&gt;Returns a list with all mounted removable devices (USB-Sticks, SD-Cards).&lt;/p&gt;
&lt;h2 id="getfilelistdirectory-allowedfileendings"&gt;getFileList(directory, allowedFileEndings)&lt;/h2&gt;
&lt;p&gt;Returns a list with all files in &lt;code&gt;directory&lt;/code&gt; which have one of the allowed file endings.&lt;br/&gt;
&lt;code&gt;AllowedFileEndings&lt;/code&gt; is a list with all allowed file endings in lowercase, e.g. &lt;span&gt;[".bmp", ".jpg", ".jpeg"]&lt;/span&gt;&lt;br/&gt;
If &lt;code&gt;AllowedFileEndings&lt;/code&gt; is empty, it will return all files regardless of the file ending.&lt;br/&gt;
&lt;code&gt;AllowedFileEndings&lt;/code&gt; is an empty list by default.&lt;/p&gt;
&lt;h2 id="getdirlistdirectory-ignorehiddendirs"&gt;getDirList(directory, ignoreHiddenDirs)&lt;/h2&gt;
&lt;p&gt;Returns a list with all directories in &lt;code&gt;directory&lt;/code&gt;. Not recursive, see below.&lt;br/&gt;
&lt;code&gt;ignoreHiddenDirs&lt;/code&gt; is &lt;code&gt;True&lt;/code&gt; by default.&lt;/p&gt;
&lt;h2 id="getalldirsrootdir-ignorehiddendirs"&gt;getAllDirs(rootdir, ignoreHiddenDirs)&lt;/h2&gt;
&lt;p&gt;Returns a list with all directories in &lt;code&gt;rootdir&lt;/code&gt; and its directories , recursively.&lt;/p&gt;
&lt;h2 id="getallfilesrootdir-allowedfileendings"&gt;getAllFiles(rootdir, allowedFileEndings)&lt;/h2&gt;
&lt;p&gt;Returns a list with all files with the allowed file endings in &lt;code&gt;rootdir&lt;/code&gt; and all of its sub directories.&lt;br/&gt;
&lt;code&gt;AllowedFileEndings&lt;/code&gt; is a list with all allowed file endings in lowercase, e.g. &lt;span&gt;[".bmp", ".jpg", ".jpeg"]&lt;/span&gt;&lt;br/&gt;
If &lt;code&gt;AllowedFileEndings&lt;/code&gt; is empty, it will return all files regardless of the file ending.&lt;br/&gt;
&lt;code&gt;AllowedFileEndings&lt;/code&gt; is an empty list by default.&lt;/p&gt;
&lt;h2 id="joinpath1-path2"&gt;join(path1, path2)&lt;/h2&gt;
&lt;p&gt;Adds &lt;code&gt;path2&lt;/code&gt; to &lt;code&gt;path1&lt;/code&gt; including the proper slash or something.&lt;/p&gt;
&lt;h2 id="trymountingdev-mntpoint-retestfalse"&gt;tryMounting(dev, mntpoint, retest=False)&lt;/h2&gt;
&lt;p&gt;Try to mount the device &lt;code&gt;dev&lt;/code&gt; at mountpoint &lt;code&gt;mntpoint&lt;/code&gt;.&lt;br/&gt;
Returns &lt;code&gt;True&lt;/code&gt; if device was mounted, else False.&lt;/p&gt;
&lt;h2 id="tryunmountingdev-mntpoint-retestfalse"&gt;tryUnmounting(dev, mntpoint, retest=False)&lt;/h2&gt;
&lt;p&gt;Try to unmount device &lt;code&gt;dev&lt;/code&gt; from mountpoint &lt;code&gt;mntpoint&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Mon, 06 Jan 2025 09:20:45 -0000</pubDate><guid>https://sourceforge.netbc6c7bb6b403e92d6cdb072ce8f5a5c95d20c58c</guid></item></channel></rss>