summaryrefslogtreecommitdiff
path: root/domestic/make/make_image.py
diff options
context:
space:
mode:
Diffstat (limited to 'domestic/make/make_image.py')
-rw-r--r--domestic/make/make_image.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/domestic/make/make_image.py b/domestic/make/make_image.py
new file mode 100644
index 0000000..2697633
--- /dev/null
+++ b/domestic/make/make_image.py
@@ -0,0 +1,24 @@
+from domestic.utility.status_message import *
+from domestic.make.make_directories import *
+from domestic.utility.get_filename import *
+from domestic.global_state import *
+
+
+def make_image(directories, data, show_image=True, success_message=None, image_type=None):
+ filename = get_filename('png')
+ username = state['session']['username']
+ path = f'{state["root"]}/{username}/{directories[-1]}/{filename}'
+ directories_to_make = [username] + [f'{username}/{directory}' for directory in directories]
+ make_directories(directories_to_make)
+
+ if image_type is None or (image_type and state['options']['information-gathering']['save']['screenshot']) or (not image_type and state['options']['information-gathering']['save']['cam-screenshot']):
+ data.save(path)
+
+ if show_image:
+ data.show()
+
+ if success_message:
+ if image_type is None or (image_type and state['options']['information-gathering']['save']['screenshot']) or (not image_type and state['options']['information-gathering']['save']['cam-screenshot']):
+ status_message(f'Path: {path}\n{success_message}', 'success')
+ else:
+ status_message(success_message, 'success') \ No newline at end of file