From 13399da7f5eea223db86ff4d30403bc714c5816c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Tue, 14 Jul 2015 17:57:06 +0200 Subject: Implemented a parser of simple pythonic definitions. --- sister.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'sister.py') diff --git a/sister.py b/sister.py index 638a0d8..c4b551c 100644 --- a/sister.py +++ b/sister.py @@ -1,12 +1,11 @@ # najprej opis -description = """ +description = """\

Predikat sister(X, Y) velja natanko takrat, kadar je X sestra od Y. Primer klica:

?- sister(X, patricia).
  X = vanessa. -

-""" +

""" # in zdaj hinti hint = {} # to je komentar @@ -19,3 +18,19 @@ hint['must_have_common_parent'] = """ hint['x_must_be_female'] = "X mora biti ženskega spola." hint['x_cant_be_own_sister'] = "X ne more biti sestra sama sebi." hint['y_not_necessarily_woman'] = "Y ni nujno ženskega spola / relacija ni simetrična." + +# a drop-down hint must supply the arguments: start (int), end (int), choices (array of string) +hint['drop_down'] = { + 'type': 'dropdown' +} +# a pop-up hint must supply the arguments: start (int), end (int), args (object of key-value args for the template, optional) +hint['popup_unknown'] = { + 'type': 'popup', + 'message': 'nekaj si zabluzil v vrstici [%=row%]' +} +# a static hint can supply an optional argument: args (object of key-value args for the template) +# a static hint can also be defined as a string instead of an object +hint['sample_static'] = { + 'type': 'static', + 'message': 'A sample static hint' +} -- cgit v1.2.1