CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Sep 26, 2018 4:29 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 18, 2018 11:36 am 
Offline

Joined: Mon Oct 20, 2014 7:05 am
Posts: 9
Hello,
an invalid repository URL given to
svn.checkout
function leads to an exception.
How can this be handeled?
Is there a possibility to check the validity of the URL before call the interface function?

Thanks in advance.

Kind regards
D. Baur


Top
   
PostPosted: Thu Mar 08, 2018 4:46 pm 
Offline

Joined: Thu Aug 11, 2016 7:15 am
Posts: 1
Hi,

we use the commandline option from TortoiseSVN with the subprocess module to check the path:

Code:
def svn_check_path(URL):
   command = 'CD C:\Program Files\TortoiseSVN\bin' # the shell command
   process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None, shell=True)
   process.communicate()
   
   command = "svn ls " + URL
   process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)

   #Launch the shell command:
   output = process.communicate()
   log = output[1].decode("cp1252");
   #Split the logs
   infos = log.splitlines();
   path_missing = False;
   for logs in infos:
      if 'warning' in logs or 'E200009' in logs:
         path_missing = True
   return(path_missing)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited