From 4fc73f1e094289b50f828f0a3128d710e1d9ec4c Mon Sep 17 00:00:00 2001 From: tassaron Date: Thu, 8 Jun 2017 20:32:25 -0400 Subject: rename and delete buttons in preset manager --- core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core.py') 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(): @@ -177,6 +178,15 @@ class Core(): def reset(self): 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])) -- cgit v1.2.3