Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Why does pyke think there's a duplicate knowledge base?

Received: by 10.229.105.81 with SMTP id s17mr443894qco.2.1305555788117;
        Mon, 16 May 2011 07:23:08 -0700 (PDT)
X-BeenThere: pyke@googlegroups.com
Received: by 10.229.208.8 with SMTP id ga8ls1331736qcb.2.gmail; Mon, 16 May
 2011 07:23:07 -0700 (PDT)
Received: by 10.229.29.77 with SMTP id p13mr437263qcc.23.1305555787751;
        Mon, 16 May 2011 07:23:07 -0700 (PDT)
Received: by 10.229.29.77 with SMTP id p13mr437262qcc.23.1305555787719;
        Mon, 16 May 2011 07:23:07 -0700 (PDT)
Return-Path: <dangy...@gmail.com>
Received: from mail-vx0-f180.google.com ([209.85.220.180])
        by gmr-mx.google.com with ESMTPS id o9si751059qcu.12.2011.05.16.07.23.07
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 16 May 2011 07:23:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of dangy...@gmail.com designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dangy...@gmail.com designates 209.85.220.180 as permitted sender) smtp.mail=dangy...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-vx0-f180.google.com with SMTP id 12so5567696vxk.39
        for <pyke@googlegroups.com>; Mon, 16 May 2011 07:23:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type;
        bh=/9Nkpw4WT3rKQtrN7p2FZl4hWOrgHEr6KASOjPqJCkk=;
        b=HPiJrbZPcCS5/JqH5SI0H6j4xuMH57+cJo40ZCyJH+WPRSO8mkoaq0jZgbPjvh+7T9
         Mh6ynnC+J7PNMqXqqXWgT8jXW/pONkvRacr1gF9F2PRmc4awaXvPZFKgAuXORpoHNnQ+
         m+m6xfpUrVhLtd+iMmavC9XPsz/g/6RbVT0+U=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        b=wAJsOO/89j/m3gbN+hNgRuQtZa5CqhE8rvz4H1ArRsjNevrPlAbkIuZaOQAdDJcyN3
         jR9j5tXWr90ekNBz8gPs+oxQnfXxik79DYhFXVH/Jmya1B3rSLSgpWE7iW2bxChzL7S9
         pmKTcaLcD3Yz6bOh2d/AIVk1bZVn5JJ6T5q8g=
MIME-Version: 1.0
Received: by 10.52.98.102 with SMTP id eh6mr6023372vdb.298.1305555787546; Mon,
 16 May 2011 07:23:07 -0700 (PDT)
Received: by 10.52.185.225 with HTTP; Mon, 16 May 2011 07:23:07 -0700 (PDT)
In-Reply-To: <4DD0B616.7010...@gmail.com>
References: <84b62b46-6d14-4ae9-a555-93c8f067c...@q12g2000prb.googlegroups.com>
	<b1d5a476-23c0-4972-a30a-4f4629a0e...@r35g2000prj.googlegroups.com>
	<4DD0B616.7010...@gmail.com>
Date: Mon, 16 May 2011 10:23:07 -0400
Message-ID: <BANLkTinpH_5Dn=WyfKOQFwBSHxkka6b...@mail.gmail.com>
Subject: Re: Why does pyke think there's a duplicate knowledge base?
From: Bruce Frederiksen <dangy...@gmail.com>
To: pyke@googlegroups.com
Content-Type: multipart/alternative; boundary=20cf307f34a2f3801304a3656497

--20cf307f34a2f3801304a3656497
Content-Type: text/plain; charset=ISO-8859-1

Hi Lauri,

I guess you're also generating rules dynamically?

Pyke was designed thinking that the rules would be relatively static (like
the source code).  And an attempt was made to allow applications to be
written that could be distributed through pypi or whatever; which means that
they would be installed into different directories on different systems.

This was done by relying on the Python path to locate the compiled_krb
directory.  You can override the default placement of the compiled_krb
directory (as well as it's name) by passing a 2-tuple rather than a string
for the path to load:

My_engine = knowledge_engine.engine(
  (rules_dir, "pyke_rules"))

Then tell Python where "pyke_rules" is by putting the directory containing
pyke_rules on your Python path (e.g., add a .pth file to your site-packages
directory).  This can be whatever directory you like, for example:
/tmp/myapp_rules.  I think that if you don't have a prefix on the target
(not "foo.pyke_rules"), you'll have to create a /tmp/myapp_rules/pyke_rules
directory with an __init__.py in it so that Pyke will find it.  If you said
"foo.pyke_rules", then the "foo" directory would have to exist, and Pyke
would create the pyke_rules directory under it.

HTH,

-Bruce

On Mon, May 16, 2011 at 1:28 AM, Lauri Kainulainen <
lauri.kainulai...@gmail.com> wrote:

> Hi all,
>
>
> On 05/16/2011 02:18 AM, Bill Janssen wrote:
>
>> It would really be great if you could tell pyke where compiled_krb
>> should go.
>>
>
> +1 for this option. We're using PyKE with Django and I would love to put
> the compiled_krb into /tmp instead of the working directory. The problem
> with the latter is that the WSGI-process does not have write access to the
> application directory and from time to time we get permission errors as the
> rules change.
>
> I know I could fix it with umask or maybe adding the compiled_krb into our
> GIT, but that doesn't seem like a pretty solution.
>
>
> Cheers,
> Lauri Kainulainen
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyKE" group.
> To post to this group, send email to pyke@googlegroups.com.
> To unsubscribe from this group, send email to
> pyke+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pyke?hl=en.
>
>

--20cf307f34a2f3801304a3656497
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Lauri,<br><br>I guess you&#39;re also generating rules dynamically?<br><=
br>Pyke was designed thinking that the rules would be relatively static (li=
ke the source code).=A0 And an attempt was made to allow applications to be=
 written that could be distributed through pypi or whatever; which means th=
at they would be installed into different directories on different systems.=
<br>
<br>This was done by relying on the Python path to locate the compiled_krb =
directory.=A0 You can override the default placement of the compiled_krb di=
rectory (as well as it&#39;s name) by passing a 2-tuple rather than a strin=
g for the path to load:<span style=3D"font-family: courier new,monospace;">=
<br>
<br></span><div style=3D"margin-left: 40px;"><span style=3D"font-family: co=
urier new,monospace;">My_engine =3D knowledge_engine.engine(<br>=A0 (rules_=
dir, &quot;pyke_rules&quot;))</span><br style=3D"font-family: courier new,m=
onospace;">
</div><br><div class=3D"gmail_quote">Then tell Python where &quot;pyke_rule=
s&quot; is by putting the directory containing pyke_rules on your Python pa=
th (e.g., add a .pth file to your site-packages directory).=A0 This can be =
whatever directory you like, for example: /tmp/myapp_rules.=A0 I think that=
 if you don&#39;t have a prefix on the target (not &quot;foo.pyke_rules&quo=
t;), you&#39;ll have to create a /tmp/myapp_rules/pyke_rules directory with=
 an __init__.py in it so that Pyke will find it.=A0 If you said &quot;foo.p=
yke_rules&quot;, then the &quot;foo&quot; directory would have to exist, an=
d Pyke would create the pyke_rules directory under it.<br>
<br>HTH,<br><br>-Bruce<br><br>On Mon, May 16, 2011 at 1:28 AM, Lauri Kainul=
ainen <span dir=3D"ltr">&lt;<a href=3D"mailto:lauri.kainulai...@gmail.com">=
lauri.kainulai...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(=
204, 204, 204); padding-left: 1ex;">
Hi all,<div class=3D"im"><br>
<br>
On 05/16/2011 02:18 AM, Bill Janssen wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
It would really be great if you could tell pyke where compiled_krb<br>
should go.<br>
</blockquote>
<br></div>
+1 for this option. We&#39;re using PyKE with Django and I would love to pu=
t the compiled_krb into /tmp instead of the working directory. The problem =
with the latter is that the WSGI-process does not have write access to the =
application directory and from time to time we get permission errors as the=
 rules change.<br>

<br>
I know I could fix it with umask or maybe adding the compiled_krb into our =
GIT, but that doesn&#39;t seem like a pretty solution.<br>
<br>
<br>
Cheers,<br><font color=3D"#888888">
Lauri Kainulainen</font><div><div></div><div class=3D"h5"><br>
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;PyKE&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:p...@googlegroups.co=
m" target=3D"_blank">pyke@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:pyke%2Bunsu=
bscribe@googlegroups.com" target=3D"_blank">pyke+unsubscr...@googlegroups.c=
om</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/pyke?hl=3Den" target=3D"_blank">http://groups.google.com/group/pyke?hl=
=3Den</a>.<br>
<br>
</div></div></blockquote></div><br>

--20cf307f34a2f3801304a3656497--