def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('ThisSelAddedToCurrSel: entered...')
    ryw_view.print_header_logo()

    rfpath = ThisSelToCurrSel.get_file_path(allowNullSearchFile=True)
    if not rfpath:
        ryw.give_bad_news(
            'ThisSelAddedToCurrSel: no selection file name found.',
            logging.error)
        DisplaySelection.exit_now(1)

    savedSel = ProcessDownloadReq.get_reqs(rfpath)
    if (not savedSel) or (len(savedSel) == 0):
        ryw.give_news('ThisSelAddedToCurrSel: this selection is empty.',
                      logging.error)
        DisplaySelection.exit_now(1)

    queueName = DeleteRepReq.get_queue_name()
    if not queueName:
        ryw.give_bad_news(
            'ThisSelToCurrSel: failed to get current selection file name.',
            logging.error)
        DisplaySelection.exit_now(1)

    queueSel = ProcessDownloadReq.get_reqs(queueName)

    AddSearchAll.union_and_write(queueSel, savedSel, queueName)
    ryw.give_news('You may want to reload the page containing '+
                  'the affected current selection.', logging.info)
    DisplaySelection.exit_now(0)
def main(rfpath,logDir,logFile):
    print_header()
    ryw.check_logging(logDir,logFile)
    logging.info('ProcessDownloadReq.main: attempted.')

    reqs = get_reqs(rfpath)
    if reqs == None:
        print "Request for download failed"
        sys.exit(1)

    success,count = add_reqs(reqs)
    if not success:
        print "Request for download failed"
        sys.exit(1)
    if count == 0:
        sys.stdout.write("True")
        sys.exit(0)
    
    success,tmppath,bakpath = write_reqs(rfpath, reqs)
    cleanup(tmppath, bakpath)
    
    if success:
	sys.stdout.write("True")
    else:
	print "Request for download failed"
def process_disk(ppp, overWrite = False):
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    mydir = os.path.join(ppp, 'repository')
    logging.debug('process_disk: attempted: ' + mydir)

    username = get_credential(mydir)
    if not username:
        return False

    ## MIRRORING HACKS
    ## If incoming disk has username equal to this repository's name,
    ## then this is a disk coming from another peer repository, and hence
    ## must be processed with care.
    ## (If the disk was coming from a village, then it would have the username
    ## of that village.)
    if username == self_name():
        ryw.give_news(
            'process_disk: processing data intended for this ' +
            'peer repository: '+ username, logging.info)
        return process_disk_from_peer_repository(mydir, ppp,
                                                 overwrite = overWrite)

    ryw.give_news('process_disk: processing data from village site: '+
                  username, logging.info)
    
    # even if this fails, (ie., we failed to process download
    # requests,) we'll keep going.
    process_download_requests(mydir, username)

    process_uploaded_objects(mydir)
            
    return True
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('ThisSelToCurrSel: entered...')
    ryw_view.print_header_logo()

    rfpath = get_file_path(allowNullSearchFile = True)
    if not rfpath:
        ryw.give_bad_news(
            'ThisSelToCurrSel: no selection file name found.',
            logging.error)
        DisplaySelection.exit_now(1)

    queueName = DeleteRepReq.get_queue_name()
    if not queueName:
        ryw.give_bad_news(
            'ThisSelToCurrSel: failed to get current selection file name.',
            logging.error)
        DisplaySelection.exit_now(1)

    try:
        shutil.copyfile(rfpath, queueName)
    except:
        ryw.give_bad_news('ThisSelToCurrSel: failed to overwrite: ' +
                          rfpath + ' -> ' + queueName,
                          logging.critical)
        DisplaySelection.exit_now(1)

    ryw.give_news(
        'This selection successfully loaded as the current selection.',
        logging.info)
    ryw.give_news('You may want to reload the page containing '+
                  'the affected current selection.', logging.info)
    ryw_view.print_footer()
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, "WWW", "logs"), "upload.log")
    logging.debug("SelectAll: entered...")

    ryw_view.print_header_logo()

    name = os.getenv("REMOTE_USER")

    if name == "" or name == None:
        ryw.give_bad_news("SelectAll: no user name given", logging.error)
        ryw_upload.quick_exit(1)

    queue = os.path.join(RepositoryRoot, "QUEUES", name)

    try:
        resources = su.parseKeyValueFile(os.path.join(RepositoryRoot, "Resources.txt"))
        searchFileName = resources["searchfile"]
    except:
        ryw.give_bad_news("SelectAll: failed to get search file name from resources.", logging.critical)
        ryw_upload.quick_exit(1)

    success, searchFile = ryw.open_search_file(
        "SelectAll:", os.path.join(RepositoryRoot, "WWW", "logs"), "upload.log", searchFileName, False
    )
    if not success:
        ryw.give_bad_news("SelectAll: failed to open search file.", logging.critical)
        ryw_upload.quick_exit(1)

    if not ProcessDownloadReq.add_all(queue, searchFile):
        ryw.give_bad_news("selectall: addAll failed.", logging.critical)
        ryw_upload.quick_exit(1)

    searchFile.done()
    ryw_upload.quick_exit(0)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('DeleteRepReq: entered...')
    queueName = get_queue_name()
    if not queueName:
        sys.exit(1)
    ProcessDownloadReq.delete_request(queueName)
    def __init__(self, logdir, logfile, reverseListsFile, exclusive,
                 skipLock = False, searchFile = None,
                 repositoryRoot = None,
                 allowNullSearchFile = False):
        """raises exceptions.
        skipLock is set to True when called by merging incoming:
        the incoming ReverseLists file is not locked."""

        if logdir and logfile:
            ryw.check_logging(logdir, logfile)
        #logging.debug('ReverseLists: initializing: ' + repr(logdir) + ' ' +
        #              repr(logfile) + ' ' + reverseListsFile)

        self.reverseListsFile = reverseListsFile
        self.lockfile = reverseListsFile + '_LOCK'
        self.exclusive = exclusive
        self.skipLock = skipLock
        self.searchFile = searchFile
        self.repositoryRoot = repositoryRoot

        if not allowNullSearchFile:
            if not searchFile or not repositoryRoot:
                raise NameError('ReverseLists.__init__: ' +
                                'bad searchFile or ' +
                                'bad repositoryRoot.')

        if not skipLock:
            logging.info('ReverseLists.__init__: skipping locking.')
            if not self._ReverseLists__create_lock_file():
                raise NameError('ReverseLists.__init__: ' +
                                '__create_lock_file failed.')

        try:
            ryw.restore_cleanup_old_version(reverseListsFile)
        except:
            pass
        
        if not os.path.exists(reverseListsFile):
            logging.warning('ReverseLists.__init__: reverseListsFile ' +
                            'not found: ' + reverseListsFile)
            self.reverseDict = {}
            try:
                su.pickdump(self.reverseDict, reverseListsFile)
            except:
                ryw.give_bad_news('ReverseLists.__init__: pickdump ' +
                                  'failed.', logging.critical)
                raise NameError('ReverseLists.__init__: __lock failed')
            
        if not self._ReverseLists__read_reverse_lists_file():
            ryw.give_bad_news(
                'ReverseLists.__init__: ' +
                '__read_reverse_lists_file failed: ' +
                reverseListsFile, logging.critical)
            raise NameError('ReverseLists.__init__: ' +
                            '__read_reverse_lists_file failed')
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('CurrSelAddedToThisSel: entered...')
    ryw_view.print_header_logo()


    success,objID,version = ryw.get_obj_str()
    if not success:
        ryw.give_bad_news('CurrSelToThisSel: failed to get objstr.',
                          logging.critical)
        DisplaySelection.exit_now(1)
    
    success,searchFile,reverseLists = \
        ReverseLists.open_searchfile_reverselists('CurrSelAddedToThisSel:')
    if not success:
        ryw.give_bad_news('CurrSelAddedToThisSel: ' +
                          'open_searchfile_reverselists failed.',
                          logging.critical)
        DisplaySelection.exit_now(1)
    

    rfpath = DisplaySelection.get_file_path(
        objID, version, searchFile = searchFile)
    if not rfpath:
        ryw.give_bad_news(
            'CurrSelAddedToThisSel: no selection file name found.',
            logging.error)
        DisplaySelection.exit_now(1)

    queueName = DeleteRepReq.get_queue_name()
    if not queueName:
        ryw.give_bad_news(
            'CurrSelToThisSel: failed to get current selection file name.',
            logging.error)
        DisplaySelection.exit_now(1)

    queueSel = ProcessDownloadReq.get_reqs(queueName)
    savedSel = ProcessDownloadReq.get_reqs(rfpath)
    newContainees = list(queueSel)

    AddSearchAll.union_and_write(savedSel, queueSel, rfpath)
    ryw.give_news('You may want to reload the page containing '+
                  'this selection.', logging.info)


    success = reverseLists.add(objID+'#'+str(version), newContainees)
    if not success:
        ryw.give_bad_news('CurrSelAddedToThisSel: reverseLists.add failed.',
                          logging.critical)

    reverseLists.done()
    searchFile.done()
    DisplaySelection.exit_now(0)
    def __init__(self, logdir, logfile, searchfile, exclusive,
                 skipRead = False, skipLock = False):
        """raises exceptions.
        skipRead is set for the case of being used by Sobti's search
        code, where he did his own reading, so all I need is to do
        the locking."""

        if logdir and logfile:
            ryw.check_logging(logdir, logfile)
        logging.debug('SearchFile: initializing: ' + repr(logdir) + ' ' +
                      repr(logfile) + ' ' + searchfile)

        self.searchfile = searchfile
        self.lockfile = searchfile + '_LOCK'
        self.exclusive = exclusive
        
        if not self._SearchFile__create_lock_file():
            raise NameError('SearchFile.__init__: __create_lock_file failed')

        ryw.restore_cleanup_old_version(searchfile)
        
        if not os.path.exists(searchfile):
            logging.warning('SearchFile.__init__: searchfile not found: ' +
                            searchfile)
            self.index = {}
            return

        if skipRead and skipLock:
            return

        if skipRead:
            #
            # not skipLock, so try to lock.
            #
            if not self._SearchFile__lock():
                ryw.give_bad_news(
                    'SearchFile.__init__: __lock failed: ' + searchfile,
                    logging.critical)
                self._SearchFile__unlock()
                raise NameError('SearchFile.__init__: __lock failed')
            #
            # lock succeeded, and we skip read, so we're done.
            #
            return

        #
        # Now we know we need to read.  May or may not lock.
        #
        if not self._SearchFile__read_search_file(skipLk = skipLock):
            ryw.give_bad_news(
                'SearchFile.__init__: __read_search_file failed: ' +
                searchfile, logging.critical)
            raise NameError('SearchFile.__init__: __read_search_file failed')
def main():
	ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
	 
	logging.debug("delete outgoing image entered")
	ryw.print_header()
	form = cgi.FieldStorage()
	if delAllReq(form):
		deleteAll()
	else:
		deleteRequested(form)
	logging.debug("delete image done")
def main_nonoverlap():
    ryw.check_logging(os.path.join(RepositoryRoot, "WWW", "logs"), "upload.log")
    logging.debug("ReadIncomingCDStack: entered...")

    success, numDiscs, resources, robotJobsDir, tmpIn = get_init_vals()
    if not success:
        sys.exit(1)

    freeGB = ryw.free_MB(tmpIn) / 1000.0
    ryw.give_news("current available disk space: " + repr(freeGB) + " GB.", logging.info)

    tmpdir, objPrefix = ryw_upload.attempt_just_make_tmpdir(tmpIn, "I_", "")
    if not tmpdir:
        ryw.give_bad_news("ReadIncomingCDStack: failed to make tmpdir.", logging.critical)
        sys.exit(1)

    ryw.give_news("begin copying incoming discs...", logging.info)

    jobFile = robot_read_all(robotJobsDir, objPrefix, numDiscs, tmpdir)
    if not jobFile:
        ryw_upload.cleanup_incoming(tmpdir, jobFile)
        sys.exit(1)

    # monitor the robot's job folder for completion of job.

    ryw.give_news("", logging.info)
    oldDone = []
    while True:
        ryw.give_news2("*", logging.info)
        time.sleep(5)
        logging.debug("ReadIncomingCDStack: done sleeping...")

        success, done, doneList = check_finished(jobFile, tmpdir)
        if not success:
            ryw_upload.cleanup_incoming(tmpdir, jobFile)
            sys.exit(1)

        if not done:
            success, doneList = check_partial_completion(tmpdir)
            if not success:
                ryw_upload.cleanup_incoming(tmpdir, jobFile)
                sys.exit(1)

        # process_finished_copies(tmpdir, doneList)
        print_done_discs(doneList, oldDone)
        oldDone = doneList

        if done:
            logging.debug("ReadIncomingCDStack: done.")
            break

    print_conclusion(doneList, tmpdir, jobFile)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('EmptyQueue: entered...')

    ryw.print_header()

    success,rfpath = ryw.get_queue_args()
    if not success:
        sys.exit(1)

    ryw.empty_download_queue(rfpath)
    sys.exit(0)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('DeleteFromSel: entered...')
    ProcessDownloadReq.print_header()

    #ProcessDownloadReq.delete_request(queue)

    form = cgi.FieldStorage()
    if (not form.has_key('objstr')) or (not form.has_key('selobj')):
        ryw.give_bad_news('DeleteFromSel.py: lacking arguments.',
                          logging.critical)
        DisplaySelection.exit_now(1)
        
    objstr = form.getfirst('objstr', '')
    selobj = form.getfirst('selobj', '')

    if (not objstr) or (not selobj):
        ryw.give_bad_news('DeleteFromSel.py: null arguments.',
                          logging.critical)
        DisplaySelection.exit_now(1)

    #ryw.give_news('DeleteFromSel.py: ' + objstr, logging.info)
    #ryw.give_news('DeleteFromSel.py: ' + selobj, logging.info)


    success,searchFile,reverseLists = \
        ReverseLists.open_searchfile_reverselists('DeleteFromSel:')
    if not success:
        ryw.give_bad_news(
            'DeleteFromSel: open_searchfile_reverselists failed.',
            logging.critical)
        DisplaySelection.exit_now(1)


    objID,version = selobj.split('#')
    version = int(version)
    rfpath = DisplaySelection.get_file_path(objID, version,
                                            searchFile=searchFile)
    if not rfpath:
        DisplaySelection.exit_now(1)

    success = ProcessDownloadReq.do_delete(rfpath, objstr)

    if success:
        sys.stdout.write("True")
    else:
        print "Failed to delete from selection."

    reverseLists.remove_obsolete_containers(objstr, [selobj])
    reverseLists.done()
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('DeleteObject: entered...')

    success,objID,version = ryw.get_obj_str()
    if not success:
        sys.exit(1)

    if do_show(objID, version):
        pass
	#sys.stdout.write("True")
        #ryw.give_good_news('Delete object: apparent success', logging.info)

    sys.exit(0)
def init(enteredMsg, headerMsg):
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug(enteredMsg)
    ryw.print_header()
    print headerMsg

    success,objID,version = ryw.get_obj_str()
    if not success:
        return (False, None, None)

    logging.debug('CreateNewThumbDir.init: objstr: ' + objID + '#' +
                  str(version))
    print ryw_view.begin_print_str()
    return (True, objID, version)
def NOTUSED_main_overlap():
    ryw.check_logging(os.path.join(RepositoryRoot, "WWW", "logs"), "upload.log")
    logging.debug("ReadIncomingCDStack: entered...")

    success, numDiscs, resources, robotJobsDir, tmpIn = get_init_vals()
    if not success:
        sys.exit(1)

    freeGB = ryw.free_MB(tmpIn) / 1000.0
    ryw.give_news("ReadIncomingCDStack: current available disk space: " + repr(freeGB) + " GB.", logging.info)

    tmpdir, objPrefix = ryw_upload.attempt_just_make_tmpdir(tmpIn, "I_", "")
    if not tmpdir:
        ryw.give_bad_news("ReadIncomingCDStack: failed to make tmpdir.", logging.critical)
        sys.exit(1)

    jobFile = robot_read_all(robotJobsDir, objPrefix, numDiscs, tmpdir)
    if not jobFile:
        ryw_upload.cleanup_incoming(tmpdir, jobFile)
        sys.exit(1)

    # monitor the robot's job folder for completion of job
    # also periodically monitor the tmp folder for completed disk reads

    while True:
        ryw.give_news2("*", logging.info)
        time.sleep(5)
        logging.debug("ReadIncomingCDStack: done sleeping...")

        success, done, doneList = check_finished(jobFile, tmpdir)
        if not success:
            ryw_upload.cleanup_incoming(tmpdir, jobFile)
            sys.exit(1)

        if not done:
            success, doneList = check_partial_completion(tmpdir)
            if not success:
                ryw_upload.cleanup_incoming(tmpdir, jobFile)
                sys.exit(1)

        process_finished_copies(tmpdir, doneList)

        if done:
            logging.debug("ReadIncomingCDStack: done.")
            break

    logging.debug("ReadIncomingCDStack: removing robot job data: " + tmpdir + " " + jobFile)
    ryw_upload.cleanup_incoming(tmpdir, jobFile)
def main():
	ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
	 
	logging.debug("outgoing disc queue entered")
	success,resources = get_resources()
	if not success:
		ryw.give_bad_news("main: error parsing resource file",logging.error)
	 
	outdir = resources['tmpout']
	dirlist = os.listdir(outdir)
	if len(dirlist) == 0:
		print "<br><h3>There are no pending outgoing discs waiting to be written\n"
	else:
		generate_table(resources,dirlist)
	
	logging.debug("generated queue page")
	ryw_view.print_footer()
Example #18
0
def mainFunc(name, tmpdir="", onlyMeta=False, discLimit=None):

    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('WriteCD.py: attempted... tmpdir: ' + tmpdir)

    if discLimit:
        ryw.set_disc_limit(discLimit)
        #ryw.give_news2('WriteCD.py: disc size set to: ' +
        #               str(ryw.maxSizeInKB), logging.info)

    success,username,rfpath,reqs = get_pathsFunc(name)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        return

    success,objKB,tmpStoreDir,tmpStoreName = \
        obj_store_size_inKB(tmpdir=tmpdir)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.critical)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

    success,reqsize,reqpath,reqList = collect_req_info(reqs, objKB)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

    success,countCDs = make_discs(reqsize, reqpath, username,
                                  objKB, tmpStoreName, reqList,
                                  tmpDirOption=tmpdir,
                                  metaOnly = onlyMeta)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

#    empty_download_queue(rfpath)
    ryw.give_good_news('Apparent success: number of CDs made = '
                       + repr(countCDs), logging.info)
#    ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
    confirm_delete_queue(rfpath)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('DeleteObject: entered...')

    ryw.print_header()

    success,objID,version = ryw.get_obj_str()
    if not success:
        sys.exit(1)

    success,searchFile = do_delete(objID, version)
    if success:
	sys.stdout.write("True")
        #ryw.give_good_news('Delete object: apparent success', logging.info)

    if searchFile:
        searchFile.done()

    sys.exit(0)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('DisplayObject: entered...')
    ryw_view.print_header_logo()

    print "<TITLE>Displaying an Object</TITLE>"

    success,objID,version = ryw.get_obj_str()
    if not success:
        ryw.give_bad_news('DisplayObject: failed to get objstr.',
                          logging.error)
        DisplaySelection.exit_now(1)

    if do_show(objID, version):
        pass
	#sys.stdout.write("True")
        #ryw.give_good_news('Delete object: apparent success', logging.info)

    DisplaySelection.exit_now(0)
Example #21
0
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, "WWW", "logs"), "upload.log")
    logging.info("ClearTmp: entered...")

    ryw_view.print_header_logo()

    try:
        resources = su.parseKeyValueFile(os.path.join(RepositoryRoot, "Resources.txt"))
        resTmpin = resources["tmpin"]
        resTmpOut = resources["tmpout"]
        robotDir = resources["robotsjobdir"]
    except:
        ryw.give_bad_news("failed to parse resource file.", logging.critical)
        sys.exit(1)

    ryw.empty_tmp_dir(resTmpin, chmodFirst=True)
    ryw.empty_tmp_dir(resTmpOut)
    ryw.empty_tmp_dir(robotDir, skipList=["Status", "Log"])

    ryw_view.print_footer()
    sys.exit(0)
def main():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('ProcessDiscs: entered...')

    success,tmpdir,jobfile,autorunMerge,overWrite = init_vals()
    if not success:
        ryw_upload.quick_exit(1)
    
    logging.debug('ProcessDiscs: tmpdir,jobfile: ' + tmpdir + ' ' + jobfile)
    ryw.give_news('processing incoming disc images located in: ' + tmpdir,
                  logging.info)

    if autorunMerge:
	    process_autorun_merge_request(tmpdir, overwrite = overWrite)
	    sys.exit(0)

    process_finished_copies(tmpdir)
    ryw_upload.cleanup_incoming(tmpdir, jobfile)
    
    ryw_view.print_footer()
    sys.exit(0)
Example #23
0
def mainFunc_old(name):
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('WriteCD.py: attempted...')

    success,username,rfpath,reqs = get_pathsFunc(name)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        return

    success,objKB,tmpStoreDir,tmpStoreName = obj_store_size_inKB()
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.critical)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

    success,reqsize,reqpath,reqList = collect_req_info(reqs, objKB)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

    success,countCDs,finishedStuff = make_discs(reqsize, reqpath, username,
                                                objKB, tmpStoreName, reqList)
    if not success:
        ryw.give_bad_news('WriteCD failed.', logging.error)
        ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
        return

#    AddRobotWriteRequest.wait_for_robot(finishedStuff)

#    empty_download_queue(rfpath)
    ryw.give_good_news('Apparent success: number of CDs made = '
                       + repr(countCDs), logging.info)

#    ryw.cleanup_path(tmpStoreDir, 'WriteCD.mainFunc:')
    confirm_delete_queue(rfpath)
    giveQManagementLink()
def main():
	ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
	logging.debug('eraseDisc.py: attempted...')
	robotJobsDir = get_resources()

	ryw_view.print_header_logo()
	
	if not robotJobsDir:
		ryw_upload.quick_exit(1)
	
	if not find_scsi_string_for_eraser(robotJobsDir):
		ryw_upload.quick_exit(1)
		
	count = 100
	filename = write_job_file(count, robotJobsDir)
	if not filename:
		ryw_upload.quick_exit(1)
	
	do_erase(filename, count, robotJobsDir)
	wait_to_end_and_cleanup(filename, count, robotJobsDir)
	
	ryw_view.print_footer()
Example #25
0
import Search,ryw_view,ryw,logging
import Browse

logDir = os.path.join(RepositoryRoot, 'WWW', 'logs')
logFile = 'upload.log'

ryw.check_logging(logDir, logFile)
logging.info('search_su: entered...')

searchFile = os.path.join(RepositoryRoot, 'SearchFile')

#
# 02/20/08
# moved to inside Search.py
# this breaks the village side,
# which probably has been long broken.
# should be easy to fix if I want to.
#
#displayObject = ryw_view.DisplayObject(RepositoryRoot,
#                                       calledByVillageSide = False,
#                                       missingFileFunc=Browse.reqDownloadFunc)

scriptName = '/cgi-bin/search_su.py'

resourcesPath = os.path.join(RepositoryRoot, 'Resources.txt')
repResources = ryw.get_resources(resourcesPath)

Search.main(logDir, logFile, searchFile, scriptName, resources = repResources)

print Browse.script_str(calledByVillageSide = False)
import cgi, cgitb, logging
cgitb.enable()
import sys, os, ryw_view, ryw
sys.path.append(os.path.join(RepositoryRoot, 'bin'))
import WriteCD



name = os.getenv("REMOTE_USER")

ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                  'upload.log')
logging.debug('FlushQueue: entered...')

ryw.print_header()
print '<TITLE>Generating Outgoing Disc</TITLE>'
ryw_view.print_logo()

#print 'Dear <B><I>' + name + ':</I></B>'


form = cgi.FieldStorage()
tmpdir = form.getfirst("tmpdir","")

if tmpdir and not ryw.is_valid_dir(tmpdir, 'FlushQueue'):
    ryw_view.print_footer()
    sys.exit(1)


meta = form.getfirst('meta', '')
metaOnly = meta == 'true' or meta == 'on'
Example #27
0
def init_log(whoCalled = 'ShowQueue'):
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug(whoCalled + ': entered...')
    name = os.getenv("REMOTE_USER")
    return name
Example #28
0
def setup_logging(logDir, logFile):
    """set up logging."""
    ryw.check_logging(logDir, logFile)
    logging.info('Search: entered...')
def setup_logging():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('EditObject: entered...')
def init_log():
    ryw.check_logging(os.path.join(RepositoryRoot, 'WWW', 'logs'),
                      'upload.log')
    logging.debug('TestReverseLists: entered...')