Skip to content
Snippets Groups Projects
Commit bbb89215 authored by anthony.boulmier's avatar anthony.boulmier
Browse files

security update

parent 1ea33ddd
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -4,7 +4,7 @@ import pprint
import os
# put here your own ip
SERVER_URL = 'http://127.0.0.1:8123'
SERVER_URL = 'http://gw-hepiacloud.hesge.ch:10005'
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Simple SOAP FTP client')
......
import SOAPpy
import sys
import argparse
import re
from os.path import expanduser, join, isdir, abspath
from os import listdir
......@@ -8,6 +9,7 @@ main_directory = None
def list(relative_directory):
global main_directory
relative_directory = re.sub('\.+', '.', relative_directory)
target_directory = join(main_directory, relative_directory) if relative_directory != '.' else main_directory
dirs = listdir(target_directory)
s = [d for d in dirs if isdir(d)]
......@@ -16,12 +18,14 @@ def list(relative_directory):
def get(relative_path):
global main_directory
relative_path = re.sub('\.+', '.', relative_path)
with open(join(main_directory,relative_path), 'r') as f:
data = f.read()
return (main_directory, relative_path, data)
def put(relative_path, data):
global main_directory
relative_path = re.sub('\.+', '.', relative_path)
new_file = join(main_directory, relative_path)
try:
with open(new_file, 'w+') as f:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment