diff --git a/README.md b/README.md index a1425e4..94f25a0 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,25 @@ What's Next: * Modify your user interface by opening WebExporter_dialog_base.ui in Qt Designer * You can use the Makefile to compile your Ui and resource files when - you make changes. This requires GNU make (gmake) \ No newline at end of file + 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 `` and `` + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2a76928 --- /dev/null +++ b/docker-compose.yml @@ -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 diff --git a/web_exporter.py b/web_exporter.py index 6a17d47..acb8835 100644 --- a/web_exporter.py +++ b/web_exporter.py @@ -179,6 +179,15 @@ class WebExporter: 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): """Run method that performs all the real work""" @@ -188,6 +197,7 @@ class WebExporter: if self.first_start == True: self.first_start = False self.dlg = WebExporterDialog() + self.dlg.button_box.accepted.connect(self.export) # show the dialog self.dlg.show() diff --git a/web_exporter_dialog_base.ui b/web_exporter_dialog_base.ui index b5f5909..e6e4838 100644 --- a/web_exporter_dialog_base.ui +++ b/web_exporter_dialog_base.ui @@ -1,7 +1,8 @@ - + + WebExporterDialogBase - - + + 0 0 @@ -9,26 +10,78 @@ 300 - + Web Exporter - - - - 30 - 240 - 341 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - + + + + + + + + + + Source folder + + + + + + + User + + + + + + + Password + + + + + + + Host + + + + + + + Port + + + + + + + Destination + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + QgsFileWidget + QWidget +
qgsfilewidget.h
+
+
@@ -37,13 +90,13 @@ WebExporterDialogBase accept() - - 248 - 254 + + 20 + 20 - - 157 - 274 + + 20 + 20 @@ -53,13 +106,13 @@ WebExporterDialogBase reject() - - 316 - 260 + + 20 + 20 - - 286 - 274 + + 20 + 20