diff --git a/nw/constants/__init__.py b/nw/constants/__init__.py index 1ffe2540..b58b56c3 100644 --- a/nw/constants/__init__.py +++ b/nw/constants/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from nw.constants.iso import isoLanguage, isoCountry from nw.constants.constants import ( - nwConst, nwRegEx, nwFiles, nwKeyWords, nwLabels, nwQuotes, nwUnicode + nwConst, nwLists, nwRegEx, nwFiles, nwKeyWords, nwLabels, nwQuotes, nwUnicode ) from nw.constants.enum import ( nwAlert, nwDocAction, nwItemClass, nwItemLayout, nwItemType, nwOutline, @@ -11,18 +11,19 @@ from nw.constants.enum import ( __all__ = [ "isoCountry", "isoLanguage", - "nwAlert", "nwConst", - "nwDocAction", - "nwDocInsert", + "nwLists", + "nwRegEx", "nwFiles", + "nwKeyWords", + "nwLabels", + "nwQuotes", + "nwUnicode", + "nwAlert", + "nwDocAction", "nwItemClass", "nwItemLayout", "nwItemType", - "nwKeyWords", - "nwLabels", "nwOutline", - "nwQuotes", - "nwRegEx", - "nwUnicode", + "nwDocInsert", ] diff --git a/nw/constants/constants.py b/nw/constants/constants.py index b0ea61c5..a39bb8e1 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -45,10 +45,19 @@ class nwConst(): SP_INTERNAL = "internal" SP_ENCHANT = "enchant" - # Check Lists +# END Class nwConst + +class nwLists(): + """Lists used for grouping various other constants. + """ + + # Regular user-accessible item types REG_TYPES = {nwItemType.ROOT, nwItemType.FOLDER, nwItemType.FILE} -# END Class nwConst + # Item classes where the full list of novel layouts are allowed + CLS_NOVEL = {nwItemClass.NOVEL, nwItemClass.ARCHIVE} + +# END Class nwLists class nwRegEx(): diff --git a/nw/guimain.py b/nw/guimain.py index 920a689e..c7ad7e55 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -47,7 +47,7 @@ from nw.gui import ( GuiTheme, GuiWritingStats ) from nw.core import NWProject, NWDoc, NWIndex -from nw.constants import nwItemType, nwItemClass, nwAlert, nwConst +from nw.constants import nwItemType, nwItemClass, nwAlert, nwLists from nw.common import getGuiItem logger = logging.getLogger(__name__) @@ -725,7 +725,7 @@ class GuiMain(QMainWindow): tItem = self.theProject.projTree[tHandle] if tItem is None: return - if tItem.itemType not in nwConst.REG_TYPES: + if tItem.itemType not in nwLists.REG_TYPES: return logger.verbose("Requesting change to item %s" % tHandle)