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.234.67 with SMTP id kb3mr364515qcb.24.1305493199446;
        Sun, 15 May 2011 13:59:59 -0700 (PDT)
X-BeenThere: pyke@googlegroups.com
Received: by 10.229.57.73 with SMTP id b9ls1162271qch.0.gmail; Sun, 15 May
 2011 13:59:58 -0700 (PDT)
Received: by 10.229.29.212 with SMTP id r20mr360355qcc.21.1305493198804;
        Sun, 15 May 2011 13:59:58 -0700 (PDT)
Received: by 10.229.29.212 with SMTP id r20mr360354qcc.21.1305493198766;
        Sun, 15 May 2011 13:59:58 -0700 (PDT)
Return-Path: <dangy...@gmail.com>
Received: from mail-vx0-f177.google.com ([209.85.220.177])
        by gmr-mx.google.com with ESMTPS id r34si984052qcp.13.2011.05.15.13.59.58
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 15 May 2011 13:59:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of dangy...@gmail.com designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dangy...@gmail.com designates 209.85.220.177 as permitted sender) smtp.mail=dangy...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by vxd2 with SMTP id 2so3550197vxd.36
        for <pyke@googlegroups.com>; Sun, 15 May 2011 13:59:58 -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=qVxUrciJUoh2EDFPBPX5WYK3QKe7n+YqXigvjs0mV0w=;
        b=M2c2Se/9GbfNsPvEoQU3s+oalPcKsDEYOfg5Ne42NssJUIqqq1RJNYUK4vDbFRZDZE
         E4mdSY6kt41kkc+8G8vSBXu9ShkEDPWFpLGqi1jnLGaY7re4FEy2KhiHESCNiLoIOsBD
         tEyvm/HK4XbDr6J72DToBWXM1Mj8MpswzOVlQ=
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=GoMeQbid7mnuR0alCduxDcZiQg/5YWVyRYSYCm7vBZMIN56N31yuAEBrF+N+1SKbg0
         tIO/KnD/4oYrra0icFXYqgT5UuLhJT5fbTnRjoPtl9FRURurTFPASOV8Fr//HdNyCDoF
         tK2IFmdYDRCKCWM5kKA5tRpZYlBxzLWns5rXs=
MIME-Version: 1.0
Received: by 10.52.111.231 with SMTP id il7mr5052182vdb.58.1305493198408; Sun,
 15 May 2011 13:59:58 -0700 (PDT)
Received: by 10.52.185.225 with HTTP; Sun, 15 May 2011 13:59:58 -0700 (PDT)
In-Reply-To: <5a7ec06d-d5e6-428f-9c9b-6be2bf3b0...@h12g2000pro.googlegroups.com>
References: <5a7ec06d-d5e6-428f-9c9b-6be2bf3b0...@h12g2000pro.googlegroups.com>
Date: Sun, 15 May 2011 16:59:58 -0400
Message-ID: <BANLkTimeYXtD95SGz5bYvh+WFywMZz=...@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=bcaec5486262590ce904a356d2ba

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

Bill,

Sorry for the limited responses to your messages.  I've been extremely busy
of late...

You have two knowledge bases called "foo".  One in /tmp/tmpqKtHPU and the
other in /tmp/tmp27aPlu.  As it happens, these are both rule bases (.krb),
but you'd get the same error if any two knowledge bases have the same name
(e.g., "foo.krb" and "foo.kfb").

I'm not sure why you have a daemon process compiling the .krb files.  Pyke
should do that for you automatically.

If these two "foo" files are from different runs of the deamon (such each
run only has one "foo" file), you might try deleting the compiled_krb
directory prior to each run.

If you see an alternate approach for Pyke to handle these files, I would be
open to hearing your ideas and letting you take a shot at it.  But I don't
have the time now to mess with it myself.  And, after all, what better way
to proudly wear "I like PyKE!" on your T-shirt than making it do what you
want yourself!

HTH,

-Bruce

On Sun, May 15, 2011 at 3:44 PM, Bill Janssen <bill.jans...@gmail.com>wrote:

> I'm trying hard to "like pyke" (t-shirt idea there:  "I like PyKE!"),
> but I'm struggling with what it's doing to my file system.  I have a
> daemon trying to compile a specific knowledge base, foo.krb, which
> I've placed in a newly created temporary directory, /tmp/problem-
> demo-6417RnK2Bu/.  But I get complaints from pyke that it's a
> "duplicate knowledge base".  I set the debug flags in
> "pyke.knowledge_engine" and "pyke.target_pkg", trying to figure this
> out; below is the output from that.
>
> It would be really nice if something would tell me what directory
> "compiled_krb" was being put in, too.
>
> Bill
>
>
> 2011-05-15T12:28:48 | engine._create_target_pkg:
> 2011-05-15T12:28:48 | /tmp/problem-demo-6417RnK2Bu
> 2011-05-15T12:28:48 | _create_target_pkg path:
> 2011-05-15T12:28:48 | '/tmp/problem-demo-6417RnK2Bu'
> 2011-05-15T12:28:48 | _create_target_pkg target_package_name:
> 2011-05-15T12:28:48 | '.compiled_krb'
> 2011-05-15T12:28:48 | _create_target_pkg path to _pythonify_path:
> 2011-05-15T12:28:48 | '/tmp/problem-demo-6417RnK2Bu'
> 2011-05-15T12:28:48 |     path_to_package:
> 2011-05-15T12:28:48 | ''
> 2011-05-15T12:28:48 |     source_package_name:
> 2011-05-15T12:28:48 | ''
> 2011-05-15T12:28:48 |     remainder_path:
> 2011-05-15T12:28:48 | '/tmp/problem-demo-6417RnK2Bu'
> 2011-05-15T12:28:48 |     zip_file_flag:
> 2011-05-15T12:28:48 | False
> 2011-05-15T12:28:48 | _create_target_pkg num_dots:
> 2011-05-15T12:28:48 | 1
> 2011-05-15T12:28:48 | _create_target_pkg absolute target_package_name:
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | _create_target_pkg target_name:
> 2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files
> 2011-05-15T12:28:48 | _get_target_pkg
> 2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files
> 2011-05-15T12:28:48 | import_:
> 2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files
> 2011-05-15T12:28:48 | _create_target_pkg: no target module
> 2011-05-15T12:28:48 | import_:
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | target_pkg: no target package
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | target_pkg package_parent_dir:
> 2011-05-15T12:28:48 | target_pkg target_package_dir:
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | target_pkg: mkdir
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | target_pkg init_filepath:
> 2011-05-15T12:28:48 | compiled_krb/__init__.py
> 2011-05-15T12:28:48 | target_pkg: creating
> 2011-05-15T12:28:48 | compiled_krb/__init__.py
> 2011-05-15T12:28:48 | target_pkg:
> 2011-05-15T12:28:48 | compiled_krb
> 2011-05-15T12:28:48 | compiled_krb/compiled_pyke_files.py
> 2011-05-15T12:28:48 | target_pkg.reset
> 2011-05-15T12:28:48 | target_pkg.add_source_package
> source_package_name:
> 2011-05-15T12:28:48 | ''
> 2011-05-15T12:28:48 |     path_from_package:
> 2011-05-15T12:28:48 | '/tmp'
> 2011-05-15T12:28:48 |     source_package_dir:
> 2011-05-15T12:28:48 | ''
> 2011-05-15T12:28:48 | target_pkg.add_source:
> 2011-05-15T12:28:48 | /tmp
> 2011-05-15T12:28:48 | tmpqKtHPU/foo.krb
> 2011-05-15T12:28:48 | rb_name:
> 2011-05-15T12:28:48 | foo
> 2011-05-15T12:28:48 | key:
> 2011-05-15T12:28:48 | ('', '/tmp', 'tmpqKtHPU/foo.krb')
> 2011-05-15T12:28:48 | tmpqKtHPU/foo.krb
> 2011-05-15T12:28:48 | needs to be compiled
> 2011-05-15T12:28:48 | target_pkg.add_source:
> 2011-05-15T12:28:48 | /tmp
> 2011-05-15T12:28:48 | tmp27aPlu/foo.krb
> 2011-05-15T12:28:48 | rb_name:
> 2011-05-15T12:28:48 | foo
> 2011-05-15T12:28:48 | Traceback (most recent call last):
>  [... 'path' is /tmp/problem-demo-6417RnK2Bu ...]
>  File "/usr/local/lib/python2.6/dist-packages/pyke/
> knowledge_engine.py", line 103, in __init__
>    self._create_target_pkg(path, target_pkgs)
>  File "/usr/local/lib/python2.6/dist-packages/pyke/
> knowledge_engine.py", line 225, in _create_target_pkg
>    source_package_dir)
>  File "/usr/local/lib/python2.6/dist-packages/pyke/target_pkg.py",
> line 224, in add_source_package
>    os.path.getmtime(source_abspath))
>  File "/usr/local/lib/python2.6/dist-packages/pyke/target_pkg.py",
> line 252, in add_source
>    raise ValueError("%s: duplicate knowledge base name" % rb_name)
> ValueError: foo: duplicate knowledge base name
>
> --
> 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.
>
>

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

Bill,<br><br>Sorry for the limited responses to your messages.=A0 I&#39;ve =
been extremely busy of late...<br><br>You have two knowledge bases called &=
quot;foo&quot;.=A0 One in /tmp/tmpqKtHPU and the other in /tmp/tmp27aPlu.=
=A0 As it happens, these are both rule bases (.krb), but you&#39;d get the =
same error if any two knowledge bases have the same name (e.g., &quot;foo.k=
rb&quot; and &quot;foo.kfb&quot;).<br>
<br>I&#39;m not sure why you have a daemon process compiling the .krb files=
.=A0 Pyke should do that for you automatically.<br><br>If these two &quot;f=
oo&quot; files are from different runs of the deamon (such each run only ha=
s one &quot;foo&quot; file), you might try deleting the compiled_krb direct=
ory prior to each run.<br>
<br>If you see an alternate approach for Pyke to handle these files, I woul=
d be open to hearing your ideas and letting you take a shot at it.=A0 But I=
 don&#39;t have the time now to mess with it myself.=A0 And, after all, wha=
t better way to proudly wear &quot;I like PyKE!&quot; on your T-shirt than =
making it do what you want yourself!<br>
<br>HTH,<br><br>-Bruce<br><br><div class=3D"gmail_quote">On Sun, May 15, 20=
11 at 3:44 PM, Bill Janssen <span dir=3D"ltr">&lt;<a href=3D"mailto:bill.ja=
ns...@gmail.com">bill.jans...@gmail.com</a>&gt;</span> wrote:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1p=
x solid rgb(204, 204, 204); padding-left: 1ex;">
I&#39;m trying hard to &quot;like pyke&quot; (t-shirt idea there: =A0&quot;=
I like PyKE!&quot;),<br>
but I&#39;m struggling with what it&#39;s doing to my file system. =A0I hav=
e a<br>
daemon trying to compile a specific knowledge base, foo.krb, which<br>
I&#39;ve placed in a newly created temporary directory, /tmp/problem-<br>
demo-6417RnK2Bu/. =A0But I get complaints from pyke that it&#39;s a<br>
&quot;duplicate knowledge base&quot;. =A0I set the debug flags in<br>
&quot;pyke.knowledge_engine&quot; and &quot;pyke.target_pkg&quot;, trying t=
o figure this<br>
out; below is the output from that.<br>
<br>
It would be really nice if something would tell me what directory<br>
&quot;compiled_krb&quot; was being put in, too.<br>
<br>
Bill<br>
<br>
<br>
2011-05-15T12:28:48 | engine._create_target_pkg:<br>
2011-05-15T12:28:48 | /tmp/problem-demo-6417RnK2Bu<br>
2011-05-15T12:28:48 | _create_target_pkg path:<br>
2011-05-15T12:28:48 | &#39;/tmp/problem-demo-6417RnK2Bu&#39;<br>
2011-05-15T12:28:48 | _create_target_pkg target_package_name:<br>
2011-05-15T12:28:48 | &#39;.compiled_krb&#39;<br>
2011-05-15T12:28:48 | _create_target_pkg path to _pythonify_path:<br>
2011-05-15T12:28:48 | &#39;/tmp/problem-demo-6417RnK2Bu&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 path_to_package:<br>
2011-05-15T12:28:48 | &#39;&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 source_package_name:<br>
2011-05-15T12:28:48 | &#39;&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 remainder_path:<br>
2011-05-15T12:28:48 | &#39;/tmp/problem-demo-6417RnK2Bu&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 zip_file_flag:<br>
2011-05-15T12:28:48 | False<br>
2011-05-15T12:28:48 | _create_target_pkg num_dots:<br>
2011-05-15T12:28:48 | 1<br>
2011-05-15T12:28:48 | _create_target_pkg absolute target_package_name:<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | _create_target_pkg target_name:<br>
2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files<br>
2011-05-15T12:28:48 | _get_target_pkg<br>
2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files<br>
2011-05-15T12:28:48 | import_:<br>
2011-05-15T12:28:48 | compiled_krb.compiled_pyke_files<br>
2011-05-15T12:28:48 | _create_target_pkg: no target module<br>
2011-05-15T12:28:48 | import_:<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | target_pkg: no target package<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | target_pkg package_parent_dir:<br>
2011-05-15T12:28:48 | target_pkg target_package_dir:<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | target_pkg: mkdir<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | target_pkg init_filepath:<br>
2011-05-15T12:28:48 | compiled_krb/__init__.py<br>
2011-05-15T12:28:48 | target_pkg: creating<br>
2011-05-15T12:28:48 | compiled_krb/__init__.py<br>
2011-05-15T12:28:48 | target_pkg:<br>
2011-05-15T12:28:48 | compiled_krb<br>
2011-05-15T12:28:48 | compiled_krb/compiled_pyke_files.py<br>
2011-05-15T12:28:48 | target_pkg.reset<br>
2011-05-15T12:28:48 | target_pkg.add_source_package<br>
source_package_name:<br>
2011-05-15T12:28:48 | &#39;&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 path_from_package:<br>
2011-05-15T12:28:48 | &#39;/tmp&#39;<br>
2011-05-15T12:28:48 | =A0 =A0 source_package_dir:<br>
2011-05-15T12:28:48 | &#39;&#39;<br>
2011-05-15T12:28:48 | target_pkg.add_source:<br>
2011-05-15T12:28:48 | /tmp<br>
2011-05-15T12:28:48 | tmpqKtHPU/foo.krb<br>
2011-05-15T12:28:48 | rb_name:<br>
2011-05-15T12:28:48 | foo<br>
2011-05-15T12:28:48 | key:<br>
2011-05-15T12:28:48 | (&#39;&#39;, &#39;/tmp&#39;, &#39;tmpqKtHPU/foo.krb&#=
39;)<br>
2011-05-15T12:28:48 | tmpqKtHPU/foo.krb<br>
2011-05-15T12:28:48 | needs to be compiled<br>
2011-05-15T12:28:48 | target_pkg.add_source:<br>
2011-05-15T12:28:48 | /tmp<br>
2011-05-15T12:28:48 | tmp27aPlu/foo.krb<br>
2011-05-15T12:28:48 | rb_name:<br>
2011-05-15T12:28:48 | foo<br>
2011-05-15T12:28:48 | Traceback (most recent call last):<br>
 =A0[... &#39;path&#39; is /tmp/problem-demo-6417RnK2Bu ...]<br>
 =A0File &quot;/usr/local/lib/python2.6/dist-packages/pyke/<br>
knowledge_engine.py&quot;, line 103, in __init__<br>
 =A0 =A0self._create_target_pkg(path, target_pkgs)<br>
 =A0File &quot;/usr/local/lib/python2.6/dist-packages/pyke/<br>
knowledge_engine.py&quot;, line 225, in _create_target_pkg<br>
 =A0 =A0source_package_dir)<br>
 =A0File &quot;/usr/local/lib/python2.6/dist-packages/pyke/target_pkg.py&qu=
ot;,<br>
line 224, in add_source_package<br>
 =A0 =A0os.path.getmtime(source_abspath))<br>
 =A0File &quot;/usr/local/lib/python2.6/dist-packages/pyke/target_pkg.py&qu=
ot;,<br>
line 252, in add_source<br>
 =A0 =A0raise ValueError(&quot;%s: duplicate knowledge base name&quot; % rb=
_name)<br>
ValueError: foo: duplicate knowledge base name<br>
<font color=3D"#888888"><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">pyke@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:pyke%2Bunsu=
bscribe@googlegroups.com">pyke+unsubscribe@googlegroups.com</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>
</font></blockquote></div><br>

--bcaec5486262590ce904a356d2ba--