-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathutils.py
More file actions
32 lines (21 loc) · 883 Bytes
/
utils.py
File metadata and controls
32 lines (21 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# Copyright © 2025 CloudBlue. All rights reserved.
#
from py_rql.transformer import BaseRQLTransformer
class ComparisonTransformer(BaseRQLTransformer):
def comp(self, args):
prop, operation, value = self._extract_comparison(args)
return operation, prop, value
class LogicalTransformer(ComparisonTransformer):
def logical(self, args):
return {args[0].data: args[0].children}
class ListTransformer(BaseRQLTransformer):
def listing(self, args):
return (self._get_value(args[0]), self._get_value(args[1]),
tuple(self._get_value(arg) for arg in args[2:]))
class SearchTransformer(BaseRQLTransformer):
def searching(self, args):
return tuple(self._get_value(args[index]) for index in range(3))
class OrderingTransformer(BaseRQLTransformer):
def ordering(self, args):
return tuple(args[1:])