Re: [basex-talk] Python client issue

2018-04-04 Thread Christian Grün
Thanks; on my list. If you happen to be able to give feedback to other
clients in the issue, that’d be marvellous.


On Wed, Apr 4, 2018 at 1:06 PM, Andrey Fedosenko
 wrote:
> Hi Christian,
>
> I left a response in my GitHub issue.
>
> 2018-03-31 17:50 GMT+03:00 Christian Grün :
>> Hi Andrey,
>>
>> I’ve seen you’ve opened a GitHub issue as well. In order to tell if
>> this is a bug, and if it’s a bug specific to Python, you may need to
>> provide us a complete code example first. Does the problem also occur
>> with a single client session?
>>
>> Best,
>> Christian
>>
>>
>>
>> On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko
>>  wrote:
>>> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>>>
>>> session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>>> session2.execute("check database")
>>>
>>> query = session.query("collection('database')")
>>>
>>> for code, item in query.iter():
>>> //some item modification
>>> session2.replace("{}.xml".format(item_path), modified_item)
>>>
>>>
>>> The execution of the script stops after the first iteration. How can I
>>> read and change data in a single cycle?
>>> FYI: for a small database, this works correctly.


Re: [basex-talk] Python client issue

2018-04-04 Thread Andrey Fedosenko
Hi Christian,

I left a response in my GitHub issue.

2018-03-31 17:50 GMT+03:00 Christian Grün :
> Hi Andrey,
>
> I’ve seen you’ve opened a GitHub issue as well. In order to tell if
> this is a bug, and if it’s a bug specific to Python, you may need to
> provide us a complete code example first. Does the problem also occur
> with a single client session?
>
> Best,
> Christian
>
>
>
> On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko
>  wrote:
>> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>>
>> session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>> session2.execute("check database")
>>
>> query = session.query("collection('database')")
>>
>> for code, item in query.iter():
>> //some item modification
>> session2.replace("{}.xml".format(item_path), modified_item)
>>
>>
>> The execution of the script stops after the first iteration. How can I
>> read and change data in a single cycle?
>> FYI: for a small database, this works correctly.


Re: [basex-talk] Python client issue

2018-03-31 Thread Christian Grün
Hi Andrey,

I’ve seen you’ve opened a GitHub issue as well. In order to tell if
this is a bug, and if it’s a bug specific to Python, you may need to
provide us a complete code example first. Does the problem also occur
with a single client session?

Best,
Christian



On Fri, Mar 30, 2018 at 12:43 PM, Andrey Fedosenko
 wrote:
> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>
> session2 = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
> session2.execute("check database")
>
> query = session.query("collection('database')")
>
> for code, item in query.iter():
> //some item modification
> session2.replace("{}.xml".format(item_path), modified_item)
>
>
> The execution of the script stops after the first iteration. How can I
> read and change data in a single cycle?
> FYI: for a small database, this works correctly.


Re: [basex-talk] python client, issue with adding xml files

2012-12-09 Thread Christian Grün
Hi Laurent,

if your client and server is placed on the same machine, you may use

  session.execute("create db /path/to/files")

Otherwise, you'll have to read the files via Python and pass them on
via create/add.

Hope this helps,
Christian
___

> The python samples pass an simple xml string to create or add:
>
>   session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
>   session.create("database", "Hello World!")
>
> but how can I request the server to open a file or a directory?
>
> Basically
>
>   session.create("database", “c:/tmp/myfile.xml")
>
> returns the following error message: "database.xml" (Line 1): No text
> allowed before root element.
>
> Thanks in advance for tips
> Laurent Le Meur
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk