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