--- a/trunk/SVN_Plugin/PLC_AC500_V3/_05_svn_commit/svnobj
+++ b/trunk/SVN_Plugin/PLC_AC500_V3/_05_svn_commit/svnobj
@@ -1,27 +1,43 @@
-Gx_l©!0…jüooŠ4´ZŸ´System.StringL{1b2bcd16-2426-4c4a-bd24-c0ad32e0aa99}ScriptContent„from ScriptEngine import *  #First Line is readonly.

+Gx_l;	!0…jüo	Y¼ª#ZŸ´System.StringL{1b2bcd16-2426-4c4a-bd24-c0ad32e0aa99}ScriptContent–from ScriptEngine import *  #First Line is readonly.

+from __future__ import print_function

 

-def set_username(req):

 

+def goodbye():

+    print("Oops.. goodbye")

+    print("--- Script finished. ---")

+    exit()

+

+

+def print_all( thistuple ):

+    for i in range( len( thistuple ) ):

+        print( thistuple[i] ) 

+

+

+def set_username( req ):

     res = system.ui.query_credentials("Credentials for SVN Repo")

-    if res:

-        ## tuple containing vowels

-        #vowels = ('a', 'e', 'i', 'o', 'u')

-        #

-        ## index of 'e' in vowels

-        #index = vowels.index('e')

-        #

-        #> print(index)

-        #

-        #> Output: 1

+    if not res:

+        goodbye()

 

-        print("Username '%s' and password '%s'" % res) # res is a 2-tuple

-        req.username = res.index(0)

-        req.password = res.index(1)

+    print_all( res )

+    req.username = res[0] # username

+    req.password = res[1] # password

+    req.save = True # Optional

+

+

+def set_commitmsg( msg ):

+    message = system.ui.query_string("Add a commit message", multi_line=True)

+    if (message):

+        msg = message    

+        print("Your commit message: " % message)

     else:

-        print("Oops.. goodbye")

-        exit()

+        print("A commit message may not not be empty")

+        goodbye()

 

-    req.save = False # Optional

 

-svn.auth_username_password += set_username

-#svn.commit(message)ScriptFileName 05_svn_commit.py ScriptParametersÐÐ-Ð-
\ No newline at end of file
+proj = projects.primary

+if proj.svn.is_versioned:

+    svn.auth_username_password += set_username

+    proj.svn.commit( set_commitmsg )

+

+print("--- Script finished. ---")

+ScriptFileName 05_svn_commit.py ScriptParametersÐÐ-Ð-
\ No newline at end of file