Преглед изворни кода

Explode dates and symbols.

tags/v1.0^2
Ben Kurtovic пре 10 година
родитељ
комит
1111afc198
1 измењених фајлова са 10 додато и 5 уклоњено
  1. +10
    -5
      bitshift/database/__init__.py

+ 10
- 5
bitshift/database/__init__.py Прегледај датотеку

@@ -68,13 +68,18 @@ class Database(object):
# (FTS: author_name) vs. node.name (_Literal)
pass
elif isinstance(node, Date):
# read node.type, node.relation
# (>=/<=: codelet_date_created / codelet_date_modified) vs. node.date (datetime.datetime)
pass
column = {node.CREATE: "codelet_date_created",
node.MODIFY: "codelet_date_modified"}[node.type]
op = {node.BEFORE: "<=", node.AFTER: ">="}[node.relation]
return "(" + column + " " + op + " ?)", [node.date]
elif isinstance(node, Symbol):
tables |= {"symbols"}
# (symbol_type, symbol_name) vs. (node.type, node.name)
pass
if node.type == node.ALL:
# OR all of the types of symbol_types
pass
else:
cond = "(symbol_type = ? AND symbol_name = ?)"
return cond, [node.type, node.name]
elif isinstance(node, BinaryOp):
left_cond, left_args = _parse_node(node.left)
right_cond, right_args = _parse_node(node.right)


Loading…
Откажи
Сачувај