diff --git a/Storage/.idea/.gitignore b/Storage/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/Storage/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/Storage/.idea/Storage.iml b/Storage/.idea/Storage.iml new file mode 100644 index 0000000..74d515a --- /dev/null +++ b/Storage/.idea/Storage.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Storage/.idea/inspectionProfiles/Project_Default.xml b/Storage/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6c993db --- /dev/null +++ b/Storage/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/Storage/.idea/inspectionProfiles/profiles_settings.xml b/Storage/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/Storage/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Storage/.idea/misc.xml b/Storage/.idea/misc.xml new file mode 100644 index 0000000..70f99a2 --- /dev/null +++ b/Storage/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/Storage/.idea/modules.xml b/Storage/.idea/modules.xml new file mode 100644 index 0000000..b069982 --- /dev/null +++ b/Storage/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Storage/main.py b/Storage/main.py new file mode 100644 index 0000000..5596b44 --- /dev/null +++ b/Storage/main.py @@ -0,0 +1,16 @@ +# This is a sample Python script. + +# Press Shift+F10 to execute it or replace it with your code. +# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. + + +def print_hi(name): + # Use a breakpoint in the code line below to debug your script. + print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. + + +# Press the green button in the gutter to run the script. +if __name__ == '__main__': + print_hi('PyCharm') + +# See PyCharm help at https://www.jetbrains.com/help/pycharm/ diff --git a/Storage/test.py b/Storage/test.py new file mode 100644 index 0000000..9a431bd --- /dev/null +++ b/Storage/test.py @@ -0,0 +1,39 @@ +from flask import Flask, request, send_file +from flask_restful import Resource, Api, reqparse +import os + +app = Flask(__name__) +api = Api(app) +app = Flask(__name__) +api = Api(app) + + +class ObjectStorage(Resource): + + def put(self, object_name): + file = request.files['file'] + file.save(object_name) + return {'status': 'success'} + + def get(self, object_name): + file = open(object_name, 'rb') + return send_file(file, mimetype='application/octet-stream') + + def delete(self, object_name): + os.remove(object_name) + + + +api.add_resource(ObjectStorage,'/objects/') + + +@app.route("/") +def hello(): + return "Hello World!" + +@app.route("/1") +def hello2(): + return "Hello aaaaa World!" + +if __name__ == "__main__": + app.run() \ No newline at end of file