Git Product home page Git Product logo

fs_filepicker's Introduction

fs_filepicker

Source Coveralls Platforms Downloads License Documentation

This project is based on PyFilesystem2 As fs_url you can enter any valid url which the fs.open_fs accepts.

docs/ui.png

Example for commandline:

~$: fs_filepicker -h
usage: fs_filepicker [-h] [-v] [-s] [-d DEFAULT_NAME] [-u FS_URL]
                     [-f FILE_PATTERN] [-t TITLE]
optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version
  -s, --save            show save button
  -d DEFAULT_NAME, --default_name DEFAULT_NAME
                        default name for saving
  -u FS_URL, --fs_url FS_URL
                        fs url to filesystem
  -f FILE_PATTERN, --file_pattern FILE_PATTERN
                        file pattern
  -t TITLE, --title TITLE
                        title of window


~$: fs_filepicker -u ftp://ftp.de.debian.org/debian

Examples for PyQt5:

from PyQt5 import QtWidgets
app = QtWidgets.QApplication([])
from fslib.fs_filepicker import getOpenFileName, getSaveFileName, getExistingDirectory, getOpenFileNameAndFilter, \
                                getSaveFileNameAndFilter
filename = getOpenFileName(parent=None, fs_url=u'~/', file_pattern=u'All Files (*)',
                         title=u'Open Config File')
print(filename)

patterns = [u'All Files (*)', u'Config Files (*.json)']
filename = getSaveFileName(parent=None, fs_url=u'~/', file_pattern=patterns,
                           default_filename=u'config.json',
                           title=u'Save Config File')
print(filename)

dirname = getExistingDirectory(parent=None, fs_url=u'~/')
print(dirname)

patterns = [u'Data Files (*.xml)', u'Config Files (*.json)']
filename, pattern = getOpenFileNameAndFilter(parent=None, fs_url=u'~/', file_pattern=patterns)
print(filename, pattern)

patterns = [u'Data Files (*.xml)', u'Config Files (*.json)']
filename, pattern = getSaveFileNameAndFilter(parent=None, fs_url=u'~/', file_pattern=patterns)
print(filename, pattern)

def load_file(self):
    from fslib.fs_filepicker import getOpenFileName
    filename = getOpenFileName(self, fs_url=u'ftp://ftp.de.debian.org/debian', file_pattern=u'All Files (*)',
                               title=u"Debian files")

fs_filepicker's People

Contributors

codacy-badger avatar github-actions[bot] avatar mr-sunglasses avatar reimarbauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fs_filepicker's Issues

review for py3

currently some modules because of encoding are used in Py2, e.g. unicode
Review for py3 needed.

seperate functions for open,save,getdir

Instead of one master function for all kind of dialogs we should seperate those in functions.
similar to QFileDialog.

  • getOpenFileName
  • getSaveFileName
  • getExistingDirectory

replacement of this QFileDialog becomes easier

This makes it also easier in other libraries to write tests by mock too

auth feature

while fs urls internally can use user:password@url we should not show this detail in the file list table

update to newer pyQT, QT version

Description

We pinned pyqt >=5, <5.13 and qt >=5.10, <5.13 because of #32

Changes

We want to release the pinning. This will either need a refactoring on our site or we found a problem on QT itselfs and have to report it there.

How to test

install the newest pyqt version and run the tests

filelist sortable

the pyqt table widget has a sort feature. the method has to become added

resizable widget

This is rather one of the last steps before 1.0

The ui elements needs changes to get resized on changing the size of the widget.

Adding pip package support.

Currently, fs_filepicker only supports the conda package manager, but the pip package manager is widely used. Also the addition of setup docs for local environment setup.

What do you think @ReimarBauer, can I start working on this issue also I have many more suggestions for fs_filepicker

directory, history navigation elements

we need further navigations to selected pathes. currently only the recent path is listed in the directory list pull down menu.

This needs to become extended to an amout of 10? used. Navigation elements have to become added.

flake8 tests shows failures

Description

pytest shows a lot FAILED conftest.py::flake-8::FLAKE8 - AttributeError: 'Application' object has no attribute 'parse_preliminary_op.

How to reproduce

pytest

Screenshots

If applicable, add screenshots to help explain your problem.

Versions

  • Operating System : linux, mambaforge

QBasicTimer::start: QBasicTimer can only be used with threads started with QThread Segmentation fault

A problem blocks building a docker container for automated tests.

It can be tried by a manual build of the container from the dockerfile
https://github.com/Open-MSS/fsfp-dockertesting

:~/PycharmProjects/fs_filepicker$ docker run -it --mount src=`pwd`,target=`pwd`,type=bind -e FSDIR=`pwd` fsfp:latest
(base) root@c685c24c890a:/# conda activate fsfp--env
(base) root@c685c24c890a:/# cd $FSDIR
(base) root@c685c24c890a:/PycharmProjects/fs_filepicker$ pytest

mostly it shows onle a "Segmentation fault"

once I got
QBasicTimer::start: QBasicTimer can only be used with threads started with QThread Segmentation fault

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.