@@ -77,11 +77,18 @@ def contains_qube(qube_list: list, qube: str) -> bool:
77
77
78
78
for entry in qube_list :
79
79
80
- if type (entry ) == str and entry == qube :
81
- return True
80
+ if type (entry ) == str :
82
81
83
- elif entry .fullmatch (qube ):
84
- return True
82
+ if entry == qube :
83
+ return True
84
+
85
+ elif type (entry ) == re .Pattern :
86
+
87
+ if entry .fullmatch (qube ):
88
+ return True
89
+
90
+ else :
91
+ raise InternalError (f'Unsupported list entry type: { type (entry )} ' )
85
92
86
93
return False
87
94
@@ -98,6 +105,12 @@ class MissingConfigException(Exception):
98
105
'''
99
106
100
107
108
+ class InternalError (Exception ):
109
+ '''
110
+ Custom exception class.
111
+ '''
112
+
113
+
101
114
class UuidCache :
102
115
'''
103
116
The UuidCache class is responsible for tracking which credentials were used most
@@ -490,6 +503,7 @@ def __init__(self, item: Secret.Item, service: Secret.Service) -> None:
490
503
491
504
if Config .getboolean ('regex' ) and self .qubes is not None :
492
505
self .qubes = list (map (re .compile , self .qubes ))
506
+ self .meta = list (map (re .compile , self .meta ))
493
507
494
508
def __str__ (self ) -> str :
495
509
'''
@@ -883,6 +897,11 @@ def main() -> None:
883
897
print ('[-] Error message: ' + str (e ))
884
898
return
885
899
900
+ except InternalError as e :
901
+ print ('[-] Internal Error.' )
902
+ print ('[-] Error message: ' + str (e ))
903
+ return
904
+
886
905
except RofiAbortedException :
887
906
print ('[+] Aborted.' )
888
907
return
0 commit comments