Modify conditions according to #618
This commit is contained in:
+6
-7
@@ -39,12 +39,11 @@ from nw.constants import (
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Translation map for item layouts
|
# Layout Translation Map
|
||||||
NOVEL_MAP = {
|
LAYOUT_MAP = {
|
||||||
nwItemLayout.SCENE: {
|
nwItemLayout.SCENE: {
|
||||||
"H1": nwItemLayout.BOOK,
|
"H1": nwItemLayout.BOOK,
|
||||||
"H2": nwItemLayout.CHAPTER,
|
"H2": nwItemLayout.CHAPTER,
|
||||||
"H4": nwItemLayout.SCENE,
|
|
||||||
},
|
},
|
||||||
nwItemLayout.CHAPTER: {
|
nwItemLayout.CHAPTER: {
|
||||||
"H1": nwItemLayout.BOOK,
|
"H1": nwItemLayout.BOOK,
|
||||||
@@ -56,7 +55,7 @@ NOVEL_MAP = {
|
|||||||
"H3": nwItemLayout.SCENE,
|
"H3": nwItemLayout.SCENE,
|
||||||
"H4": nwItemLayout.SCENE,
|
"H4": nwItemLayout.SCENE,
|
||||||
},
|
},
|
||||||
nwItemLayout.BOOK: {
|
nwItemLayout.PARTITION: {
|
||||||
"H2": nwItemLayout.CHAPTER,
|
"H2": nwItemLayout.CHAPTER,
|
||||||
"H3": nwItemLayout.SCENE,
|
"H3": nwItemLayout.SCENE,
|
||||||
"H4": nwItemLayout.SCENE,
|
"H4": nwItemLayout.SCENE,
|
||||||
@@ -241,9 +240,9 @@ class NWTree():
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
iLayout = tItem.itemLayout
|
iLayout = tItem.itemLayout
|
||||||
if iLayout in NOVEL_MAP:
|
if iLayout in LAYOUT_MAP:
|
||||||
if hLevel in NOVEL_MAP[iLayout]:
|
if hLevel in LAYOUT_MAP[iLayout]:
|
||||||
tItem.itemLayout = NOVEL_MAP[iLayout][hLevel]
|
tItem.itemLayout = LAYOUT_MAP[iLayout][hLevel]
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user