#!/usr/bin/python
import sys
from os import path
file_path = str(sys.argv[1])
# Need to append server root path to ensure we can import the necessary files.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from mod_upload.controllers import upload_ftp
from database import create_session
from run import config, log
from mod_upload.models import QueuedSample
from mod_sample.models import Sample

if __name__ == '__main__':
    db = create_session(config['DATABASE_URI'])
    log.info("In the progree ftp upload")
    upload_ftp(db, file_path)

@@ -46,37 +46,8 @@
 ath%0A
-file_path = str(sys.argv%5B1%5D)%0A
 # Ne
@@ -193,330 +193,427 @@
 )))%0A
-from mod_upload.controllers import upload_ftp%0Afrom database import create_session%0Afrom run import config, log%0Afrom mod_upload.models import QueuedSample%0Afrom mod_sample.models import Sample%0A%0Aif __name__ == '__main__':%0A    db = create_session(config%5B'DATABASE_URI'%5D)%0A    log.info(%22In the progree ftp upload%22)%0A    upload_ftp
+%0A%0Adef process(database, file_to_process):%0A    from mod_upload.controllers import upload_ftp%0A    from run import log%0A    log.debug(%22Calling the FTP upload method from the controller!%22)%0A    upload_ftp(database, file_to_process)%0A%0Aif __name__ == '__main__':%0A    from database import create_session%0A    from run import config, log%0A%0A    db = create_session(config%5B'DATABASE_URI'%5D)%0A    file_path = str(sys.argv%5B1%5D)%0A    process
 (db,

Update the process script