aboutsummaryrefslogtreecommitdiff
path: root/core.py
diff options
context:
space:
mode:
authortassaron2017-06-08 20:32:25 -0400
committertassaron2017-06-08 20:32:25 -0400
commit4fc73f1e094289b50f828f0a3128d710e1d9ec4c (patch)
treecc9f1b633c3f71f1caeed9688b4e9564513976b8 /core.py
parentbb1e54b31eb6157ef041764cfccd60484a0e02d8 (diff)
rename and delete buttons in preset manager
Diffstat (limited to 'core.py')
-rw-r--r--core.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/core.py b/core.py
index 797749d..06367cf 100644
--- a/core.py
+++ b/core.py
@@ -14,6 +14,7 @@ from collections import OrderedDict
import json
from importlib import import_module
from PyQt4.QtGui import QDesktopServices
+import string
class Core():
@@ -178,6 +179,15 @@ class Core():
self.canceled = False
@staticmethod
+ def badName(name):
+ '''Returns whether a name contains non-alphanumeric chars'''
+ badName = False
+ for letter in name:
+ if letter in string.punctuation:
+ badName = True
+ return badName
+
+ @staticmethod
def stringOrderedDict(dictionary):
sorted_ = OrderedDict(sorted(dictionary.items(), key=lambda t: t[0]))
return repr(sorted_)