Best Python code snippet using localstack_python
sourceforge.py
Source:sourceforge.py
1import utils.checked_system2import os3import sys4site_dir = '/home/groups/b/bo/boost/htdocs/'5def download( source, destination, user ):6 if sys.platform == 'win32':7 destination = os.popen( 'cygpath "%s"' % destination ).read().splitlines()[0]8 utils.checked_system( [ 9 'rsync -v -r -z --progress %(user)s@shell.sourceforge.net:%(site_dir)s%(source)s %(dest)s'10 % { 'user': user, 'site_dir': site_dir, 'source': source, 'dest': destination }11 ] )12def upload( source, destination, user ):13 if sys.platform == 'win32':14 source = os.popen( 'cygpath "%s"' % source ).read().splitlines()[0]15 16 utils.checked_system( [ 17 'rsync -v -r -z --progress %(source)s %(user)s@shell.sourceforge.net:%(site_dir)s%(dest)s'18 % { 'user': user, 'site_dir': site_dir, 'source': source, 'dest': destination }19 ] )20def checked_system( commands, user, background = False ):21 if not background:22 cmd = 'ssh -l %s shell.sourceforge.net "%s"'23 else:24 cmd = 'ssh -f -l %s shell.sourceforge.net "%s"'25 utils.checked_system( 26 [ cmd % ( user, '&&'.join( commands ) ) ]27 )28def untar( archive, user, background ):29 checked_system( 30 [31 'cd %s' % os.path.join( site_dir, os.path.dirname( archive ) )32 , 'tar -x -z --overwrite --mode=+w -f %s' % os.path.basename( archive )33 , 'rm -f %s' % archive34 ]35 , user = user36 , background = background...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!