mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-22 00:05:16 -05:00
Ignore comments
This commit is contained in:
@@ -6,6 +6,7 @@ import re
|
||||
import sys
|
||||
|
||||
defaultLocaleFile = "en-US.ini"
|
||||
commentChars = ";#"
|
||||
|
||||
|
||||
class localeEntry:
|
||||
@@ -21,6 +22,13 @@ class localeEntry:
|
||||
self.lineNum = lineNum
|
||||
|
||||
|
||||
def isCommentLine(line):
|
||||
for char in commentChars:
|
||||
if line.startswith(char):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def getNonDefaultLocales(dir):
|
||||
files = []
|
||||
for filename in os.listdir(dir):
|
||||
@@ -38,7 +46,7 @@ def getAllLocaleEntries(file):
|
||||
widgetPlaceholders = []
|
||||
qStringArgs = []
|
||||
|
||||
if line.startswith(";"):
|
||||
if isCommentLine(line):
|
||||
continue
|
||||
|
||||
for word in line.split("{{"):
|
||||
|
||||
Reference in New Issue
Block a user