summaryrefslogtreecommitdiff
path: root/squaredeal
diff options
context:
space:
mode:
Diffstat (limited to 'squaredeal')
-rw-r--r--squaredeal/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/squaredeal/__init__.py b/squaredeal/__init__.py
index dc1d2d4..5a9f80b 100644
--- a/squaredeal/__init__.py
+++ b/squaredeal/__init__.py
@@ -52,7 +52,11 @@ class SquareDeal(object):
self.sqd.name = arguments.get('event_name')
self.sqd.delayed_info = arguments.get('delayed_information')
- self.sqd.tofile(arguments.get('sqd_file'))
+ sqd_file = arguments.get('sqd_file')
+ if os.path.exists(sqd_file) and not arguments.get('overwrite'):
+ raise FileExistsError(sqd_file)
+
+ self.sqd.tofile(sqd_file)
def set_name(self, **arguments):
self.sqd.fromfile(arguments.get('sqd_file'), sqkpath=arguments.get('sqk_file'))