<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/</id><updated>2020-02-27T14:51:41.550000Z</updated><subtitle>Recent posts to need python example of loading project from a svn revision</subtitle><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#70f2" rel="alternate"/><published>2020-02-27T14:51:41.550000Z</published><updated>2020-02-27T14:51:41.550000Z</updated><author><name>DBe</name><uri>https://forge.codesys.com/u/dbe/</uri></author><id>https://forge.codesys.comca5a5a63e7548bf42e9873301f67085ad2d0967e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;thank you again - this works fine for all ssh scenarios and users!&lt;br/&gt;
No auth cache needed anymore  &lt;/p&gt;
&lt;p&gt;Best regards&lt;br/&gt;
Dirk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#f5b0" rel="alternate"/><published>2020-02-27T14:51:39.851000Z</published><updated>2020-02-27T14:51:39.851000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com087b2a60af0a3fdd0a893adf8496b740b19671f3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi DBe.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DBe hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
is it possible to give svn user and password as a parameter to svn.checkout or similiar (e.g. AuthenticationRequest)?&lt;br/&gt;
Or should I go with the auth cache set manually for each user within Codesys UI?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Some example code:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;set_username&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;print_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;"userX"&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;"test"&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;True&lt;/span&gt; &lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;
&lt;span class="n"&gt;svn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth_username_password&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;set_username&lt;/span&gt;
&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;svn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;For more details please look at the Scripting API for SVN which is installed with the CODESYS SVN Add-On.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#a94c" rel="alternate"/><published>2020-02-27T14:51:39.206000Z</published><updated>2020-02-27T14:51:39.206000Z</updated><author><name>DBe</name><uri>https://forge.codesys.com/u/dbe/</uri></author><id>https://forge.codesys.com625f5e50510c9c46aca168a27277efb495c2c9d2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;is it possible to give svn user and password as a parameter to svn.checkout or similiar (e.g. AuthenticationRequest)?&lt;br/&gt;
Or should I go with the auth cache set manually for each user within Codesys UI?&lt;/p&gt;
&lt;p&gt;Reason: A build server script would like to access the codesys machine via ssh, programatically do a checkout of a project and codesys build.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br/&gt;
Dirk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#569e" rel="alternate"/><published>2020-02-27T14:51:38.484000Z</published><updated>2020-02-27T14:51:38.484000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com77a30e6c5df157fd5b06b2d49b47fd1120c88415</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; M.Schaber&lt;/p&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the CODESYS SVN AddOn stores the CODESYS projects as a tree of files and directories, so you can commit and compare on a per-object basis.&lt;/p&gt;
&lt;p&gt;As CODESYS projects are "natively" stored in an object database, the mapping is not straight forward, and you won't be able to work on CODESYS Sources using TortoiseSVN.&lt;/p&gt;
&lt;p&gt;On the other hand, the SVN AddOn will not work with a CODESYS project file stored with TortoiseSVN.&lt;/p&gt;
&lt;p&gt;As you write about ENI server - this product is not really supported any more (for CODESYS V3).&lt;/p&gt;
&lt;p&gt;HTH,&lt;br/&gt;
Markus&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#9f9b" rel="alternate"/><published>2020-02-27T14:51:36.769000Z</published><updated>2020-02-27T14:51:36.769000Z</updated><author><name>DBe</name><uri>https://forge.codesys.com/u/dbe/</uri></author><id>https://forge.codesys.come8f0917574e389368cd0454bbc8137f31dd51ee0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;in fact we use Tortoise SVN and ENI Server for storing Codesys sources. &lt;br/&gt;
We don't store the projects due to their size and other collaboration reasons.&lt;br/&gt;
So I assume Tortoise SVN sources can not be checked out by Codesys SVN, right or wrong?&lt;br/&gt;
One possible solution that appears to me could be:&lt;br/&gt;
1. Store Codesys sources with Tortoise SVN&lt;br/&gt;
2. Use Codesys SVN to check out sources via API for continous integration build process only&lt;br/&gt;
If Tortoise and Codesys SVN can coexist just for a simple check-out then investing 500€ for this package will be my preferred solution.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br/&gt;
Dirk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#cb88" rel="alternate"/><published>2020-02-27T14:51:36.156000Z</published><updated>2020-02-27T14:51:36.156000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com2091edec3a72e06cb25cbcfaf798906f6cab37e2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi DBe.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DBe hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Within this forum I found several approaches:&lt;br/&gt;
1. svn.checkout() or projects.primary.svn.checkout? &lt;br/&gt;
2. system.commands&lt;span&gt;["svn", "copy"]&lt;/span&gt;.execute("svn://new/destination/url", "false", "commit message")&lt;br/&gt;
3. os.popen('"' + SVNEXE + '" cat ' + XMLURL, 'r') as pipe:....&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you have CODESYS SVN you can use the API described in the  of the CHM file . For example, you can checkout a project using svn.checkout('url', 'directory', 'project_name') in a python script and run it in CODESYS.&lt;/p&gt;
&lt;p&gt;If you don't have CODESYS SVN you can only work with the normal files. For example, you can checkout a project file and open it in CODESYS but you don't have any SVN features or operation inside CODESYS.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#3b07" rel="alternate"/><published>2020-02-27T14:51:35.595000Z</published><updated>2020-02-27T14:51:35.595000Z</updated><author><name>DBe</name><uri>https://forge.codesys.com/u/dbe/</uri></author><id>https://forge.codesys.com45fefefd608bc0ad37e144e06a9d92b324c9fb19</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello together,&lt;/p&gt;
&lt;p&gt;svn checkout works? Really? How? &lt;br/&gt;
What is the namespace ov svn.checkout()?&lt;br/&gt;
What is the object that the function can be applied to?&lt;/p&gt;
&lt;p&gt;Within docs I found SubversionIntegration.ScriptDriver - but how to use it?&lt;br/&gt;
Within forum I found "Find some API within ScriptEngine_SVN_4040.chm"&lt;br/&gt;
Within this forum I found several approaches:&lt;br/&gt;
1. svn.checkout() or projects.primary.svn.checkout? &lt;br/&gt;
2. system.commands&lt;span&gt;["svn", "copy"]&lt;/span&gt;.execute("svn://new/destination/url", "false", "commit message")&lt;br/&gt;
3. os.popen('"' + SVNEXE + '" cat ' + XMLURL, 'r') as pipe:....&lt;/p&gt;
&lt;p&gt;Does any of these ideas work for checkout?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br/&gt;
Dirk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#739c" rel="alternate"/><published>2020-02-27T14:51:34.024000Z</published><updated>2020-02-27T14:51:34.024000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.coma1a90532f3b1b5aaa45a150d1c5ddff64e0878b5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi anson2004.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;anson2004 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Exception: The object 'Device' cannot be modified because it could not be locked in the SVN repository.&lt;br/&gt;
Details: Path '/svn_url/Device/svnobj' is already locked by user 'xxx.xx' in filesystem 'a6267ff8-34b0-244c-8b93-125bfbd9a58b'&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Set the automatic locking in the SVN settings (see Options) to "Never acquire a lock automatically" and try again.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#5f47" rel="alternate"/><published>2020-02-27T14:51:33.458000Z</published><updated>2020-02-27T14:51:33.458000Z</updated><author><name>anson2004</name><uri>https://forge.codesys.com/u/anson2004/</uri></author><id>https://forge.codesys.com6b437141584b9ef4512ef0cf88a99d49ba3acaf9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;
&lt;p&gt;The svn checkout work.&lt;/p&gt;
&lt;p&gt;I have a problem after svn checkout. I try to login to a specific target device using set_gateway_and_address method. I specify correct guid and address. But I got runtime error:&lt;/p&gt;
&lt;p&gt;Exception: The object 'Device' cannot be modified because it could not be locked in the SVN repository.&lt;br/&gt;
Details: Path '/svn_url/Device/svnobj' is already locked by user 'xxx.xx' in filesystem 'a6267ff8-34b0-244c-8b93-125bfbd9a58b'&lt;/p&gt;
&lt;p&gt;What could go wrong?&lt;/p&gt;
&lt;p&gt;Yiqing&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>need python example of loading project from a svn revision</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/51455743ca/?limit=25#7694" rel="alternate"/><published>2020-02-27T14:51:32.872000Z</published><updated>2020-02-27T14:51:32.872000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com508c88426da64ed722edcb20c23e22544ed8113a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi anson2004.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;anson2004 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I follow this post  l &lt;a class="" href="http://forum.codesys.com/viewtopic.php?t=1890" rel="nofollow"&gt;viewtopic.php?t=1890&lt;/a&gt; l  and successfully open a project and print the value. But with SVN example it failed and I do not understand how this svn code checkout repo even.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;anson2004 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
So could someone provide a python example of checkout svn repo first, then setup a Codesys project? It is even better if there is a way to include library.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;checkout&lt;/span&gt; &lt;span class="n"&gt;my&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt;
&lt;span class="n"&gt;svn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;"svn://svnserver/somefolder/MyProject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="ss"&gt;"c:\temp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;"MyProject"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;anson2004 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Also I would like to know where could I find the document of python script? It will be useful for me to see how much I can do using python script.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can find the API documentation "ScriptEngine.chm" in the sub directory OnlineHelp in the CODESYS main directory. The API documentation "ScriptEngine_SVN_4040.chm" can be found in one of its sub directories.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>