mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-16 03:38:50 +01:00
Add EXCLUDE parameter for emulator config
This commit is contained in:
parent
dac49f9df9
commit
e6d2b43c25
@ -4,6 +4,7 @@ import os
|
|||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import gobject
|
import gobject
|
||||||
import validators
|
import validators
|
||||||
@ -150,11 +151,18 @@ class RomListPage(Page):
|
|||||||
|
|
||||||
bname = os.path.basename(v) ### filter extension
|
bname = os.path.basename(v) ### filter extension
|
||||||
if len(bname)> 1:
|
if len(bname)> 1:
|
||||||
pieces = bname.split(".")
|
is_excluded = False
|
||||||
if len(pieces) > 1:
|
for exclude_pattern in self._Emulator["EXCLUDE"]:
|
||||||
if pieces[ len(pieces)-1 ].lower() in self._Emulator["EXT"]:
|
if re.match(exclude_pattern, bname):
|
||||||
dirmap["file"] = v
|
is_excluded = True
|
||||||
ret.append(dirmap)
|
break
|
||||||
|
|
||||||
|
if not is_excluded:
|
||||||
|
pieces = bname.split(".")
|
||||||
|
if len(pieces) > 1:
|
||||||
|
if pieces[ len(pieces)-1 ].lower() in self._Emulator["EXT"]:
|
||||||
|
dirmap["file"] = v
|
||||||
|
ret.append(dirmap)
|
||||||
# else:
|
# else:
|
||||||
# print("not file or dir")
|
# print("not file or dir")
|
||||||
|
|
||||||
|
|||||||
@ -440,6 +440,7 @@ class MainScreen(object):
|
|||||||
obj["ROM"] = ""
|
obj["ROM"] = ""
|
||||||
obj["ROM_SO"] =""
|
obj["ROM_SO"] =""
|
||||||
obj["EXT"] = []
|
obj["EXT"] = []
|
||||||
|
obj["EXCLUDE"] = []
|
||||||
obj["FILETYPE"] = "file"
|
obj["FILETYPE"] = "file"
|
||||||
obj["LAUNCHER"] = ""
|
obj["LAUNCHER"] = ""
|
||||||
obj["TITLE"] = "Game"
|
obj["TITLE"] = "Game"
|
||||||
@ -459,6 +460,8 @@ class MainScreen(object):
|
|||||||
if len(pis) > 1:
|
if len(pis) > 1:
|
||||||
if "EXT" in pis[0]:
|
if "EXT" in pis[0]:
|
||||||
obj[pis[0]] = pis[1].split(",")
|
obj[pis[0]] = pis[1].split(",")
|
||||||
|
elif "EXCLUDE" in pis[0]
|
||||||
|
obj[pis[0]] = pis[1].split(",")
|
||||||
else:
|
else:
|
||||||
obj[pis[0]] = pis[1]
|
obj[pis[0]] = pis[1]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user