Base pour Gaspard
This commit is contained in:
parent
ef06ad583b
commit
e602b4c143
21
README.md
21
README.md
@ -32,3 +32,24 @@ What's Next:
|
|||||||
|
|
||||||
* You can use the Makefile to compile your Ui and resource files when
|
* You can use the Makefile to compile your Ui and resource files when
|
||||||
you make changes. This requires GNU make (gmake)
|
you make changes. This requires GNU make (gmake)
|
||||||
|
|
||||||
|
## Use docker to test the plugin
|
||||||
|
|
||||||
|
Docker test images to test connexions.
|
||||||
|
|
||||||
|
Start containers:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
and connect with
|
||||||
|
|
||||||
|
| protocol | login | password | address | port |
|
||||||
|
|----------|-------|----------|---------|------|
|
||||||
|
| ftps | username | password | localhost | 4567 |
|
||||||
|
| sftp | foo | pass | localhost | 4522 |
|
||||||
|
|
||||||
|
Be sure all file and dirs in `test/mnt` are recursively chown with `<you_user>` and `<your_group>`
|
||||||
|
|
||||||
|
|
||||||
|
25
docker-compose.yml
Normal file
25
docker-compose.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
version: "3.6"
|
||||||
|
services:
|
||||||
|
|
||||||
|
# FTP, FTPS
|
||||||
|
# https://hub.docker.com/r/mikatux/ftps-server
|
||||||
|
ftps_server:
|
||||||
|
image: mikatux/ftps-server
|
||||||
|
volumes:
|
||||||
|
- ./mnt/ftps_server:/home/username
|
||||||
|
environment:
|
||||||
|
USER: username
|
||||||
|
PASSWORD: password
|
||||||
|
ports:
|
||||||
|
- "4567:21"
|
||||||
|
- "3000-3010:3000-3010"
|
||||||
|
|
||||||
|
# SFTP (SSH)
|
||||||
|
# https://hub.docker.com/r/atmoz/sftp
|
||||||
|
sftp_server:
|
||||||
|
image: atmoz/sftp:debian
|
||||||
|
volumes:
|
||||||
|
- ./mnt/sftp_server:/home/foo/upload
|
||||||
|
ports:
|
||||||
|
- "4522:22"
|
||||||
|
command: foo:pass:1000
|
@ -179,6 +179,15 @@ class WebExporter:
|
|||||||
action)
|
action)
|
||||||
self.iface.removeToolBarIcon(action)
|
self.iface.removeToolBarIcon(action)
|
||||||
|
|
||||||
|
def export(self):
|
||||||
|
print("TODO : send file from the folder to the ftp")
|
||||||
|
"""
|
||||||
|
from ftplib import FTP
|
||||||
|
ftp = FTP()
|
||||||
|
ftp.connect('0.0.0.0', 4567)
|
||||||
|
ftp.login('username', 'password')
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Run method that performs all the real work"""
|
"""Run method that performs all the real work"""
|
||||||
@ -188,6 +197,7 @@ class WebExporter:
|
|||||||
if self.first_start == True:
|
if self.first_start == True:
|
||||||
self.first_start = False
|
self.first_start = False
|
||||||
self.dlg = WebExporterDialog()
|
self.dlg = WebExporterDialog()
|
||||||
|
self.dlg.button_box.accepted.connect(self.export)
|
||||||
|
|
||||||
# show the dialog
|
# show the dialog
|
||||||
self.dlg.show()
|
self.dlg.show()
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
<class>WebExporterDialogBase</class>
|
<class>WebExporterDialogBase</class>
|
||||||
<widget class="QDialog" name="WebExporterDialogBase" >
|
<widget class="QDialog" name="WebExporterDialogBase">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
@ -9,26 +10,78 @@
|
|||||||
<height>300</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>Web Exporter</string>
|
<string>Web Exporter</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="button_box" >
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="geometry" >
|
<item>
|
||||||
<rect>
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<x>30</x>
|
<item row="5" column="1">
|
||||||
<y>240</y>
|
<widget class="QgsFileWidget" name="mQgsFileWidget"/>
|
||||||
<width>341</width>
|
</item>
|
||||||
<height>32</height>
|
<item row="5" column="0">
|
||||||
</rect>
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Source folder</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation" >
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>User</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Password</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Host</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Port</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Destination</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="button_box">
|
||||||
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons" >
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>QgsFileWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>qgsfilewidget.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
@ -37,13 +90,13 @@
|
|||||||
<receiver>WebExporterDialogBase</receiver>
|
<receiver>WebExporterDialogBase</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="source_label" >
|
<hint type="sourcelabel">
|
||||||
<x>248</x>
|
<x>20</x>
|
||||||
<y>254</y>
|
<y>20</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destination_label" >
|
<hint type="destinationlabel">
|
||||||
<x>157</x>
|
<x>20</x>
|
||||||
<y>274</y>
|
<y>20</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
@ -53,13 +106,13 @@
|
|||||||
<receiver>WebExporterDialogBase</receiver>
|
<receiver>WebExporterDialogBase</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="source_label" >
|
<hint type="sourcelabel">
|
||||||
<x>316</x>
|
<x>20</x>
|
||||||
<y>260</y>
|
<y>20</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destination_label" >
|
<hint type="destinationlabel">
|
||||||
<x>286</x>
|
<x>20</x>
|
||||||
<y>274</y>
|
<y>20</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
Loading…
Reference in New Issue
Block a user