-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script d'import de photos #85
Conversation
add gallery
add edit marker
Merci beaucoup pour ce travail documenté. Merci. |
En effet la branche dev n'était pas à jour et j'ai créé la branche ftpclient avant de m'en rendre compte. J'ai donc du faire un pull de master. Pour tester tu pourrais dans un premier temps le configurer de sorte qu'il n'enregistre rien en base et vérifier que :
Puis, essayer de cibler très peu de fichiers pour l'import via l'inputpattern et vérifier que tout est bien enregistré en base. La plupart de ces specs sont checkés automatiquement lors des tests normalement. |
Oui c'est bien que la branche Merci. |
Geo-paysages FTP client (#79 )
Script that fetches site images from FTP Servers
Installation
From the folder
GeoPaysages/geopaysagesftpclient
(and inside your virtual env)For production
pip install .
For development
pip install -e ".[dev]"
Development mode is required for running sphinx and pytest.
Once the installation is completed, the script
fetchsiteimages
should be created in your virtual environment.Running the script
config.ini
(see the configuration section below)fetchsiteimages
by providing your config fileConfiguration
config.ini.tpl
intoconfig.ini
A sample configuration file is the following
Configuration options
Patterns
The inputpattern option specifies how to target the files to fetch from the FTP server and how to parse informations from their path. While the outputpattern specifies how to name the retrieved files using the parsed informations.
Example
Using the following configuration for a site, say, glacierblanc_lateral
A file located at
images/testsite/2020-10-08/img10001.JPG
in the FTP server will match the inputpattern with the following matchdictand will be saved at
home/mv/Pictures/retrieved_images/glacierblanc_lateral/2020_10_08.JPG
Built-in patterns
Additionally to the python regex expressions, you can use the script built-in expressions.
.jpg
,.jpeg
,.git
,.png
,.bmp
Defining custom match group
You can define custom match group using the syntax
{exp:name}
whereexp
is a regular expression andname
is the key for the match.Example
Using the following configuration
a file located at
images/Carl/2020-10-08/image10001.jpg
will match the inputpattern with the matchdictand will be saved to
retrieved_images/glacierblanc_lateral/2020_10_08_Carl.jpg
.Testing (dev installation mode only)
pytest.ini.tpl
intopytest.ini
pytest.ini
file (This file is required to be namedpytest.ini
).pytest -s -v
from a terminal.