Exemplo n.º 1
0
def show_one_server_object(meta, searchFile):
    """like WebUpload_ryw.show_one_server_object() except that
    the searchFile is passed in."""
    
    print "<BR>"
    print Browse.script_str()
    #displayObject = ryw_view.DisplayObject(RepositoryRoot,
    #                                       calledByVillageSide = False,
    #                                       missingFileFunc = None)

    success,reverseLists = ReverseLists.open_reverse_lists(
        'EditObject:', '', '',
        os.path.join(RepositoryRoot, 'ReverseLists'), True,
        searchFile = searchFile,
        repositoryRoot = RepositoryRoot)
    if not (success and reverseLists):
        ryw.give_bad_news('EditObject: failed to open ReverseLists.',
                          logging.critical)
        if reverseLists:
            reverseLists.done()
        return False

    displayObject = ryw_view.DisplayObject(
        RepositoryRoot, calledByVillageSide = False,
        missingFileFunc = Browse.reqDownloadFunc,
        searchFile = searchFile,
        reverseLists = reverseLists)
    
    displayObject.begin_print()
    displayObject.show_an_object_compact(meta)
    displayObject.end_print()
    reverseLists.done()
Exemplo n.º 2
0
def show_one_server_object(meta):

    success, searchFile, reverseLists = ReverseLists.open_searchfile_reverselists(
        "WebUpload_ryw.show_one_server_object:"
    )
    if not success:
        return None

    print Browse.script_str()

    # displayObject = ryw_view.DisplayObject(RepositoryRoot,
    #                                       calledByVillageSide = False,
    #                                       missingFileFunc = None)
    displayObject = ryw_view.DisplayObject(
        RepositoryRoot,
        calledByVillageSide=False,
        missingFileFunc=Browse.reqDownloadFunc,
        searchFile=searchFile,
        reverseLists=reverseLists,
    )

    displayObject.begin_print()
    displayObject.show_an_object_compact(meta)
    displayObject.end_print()

    reverseLists.done()
    return searchFile
def print_title(objID, version, name, searchFile):
    if not searchFile:
        raise NameError('DisplaySelection.print_title: no searchFile')

    success,meta = searchFile.get_meta(objID, version)
    #success,meta,objroot = ryw_meta.get_meta2(RepositoryRoot,
    #                                          objID, version)

    if not success:
        ryw.give_bad_news('DisplaySelection: failed to find this selection.',
                          logging.error)
        return False
    
    if success and meta.has_key('title'):
        name = meta['title']
    obj = meta['id'] + '#' + str(meta['version'])
    print_header(name, objstr = obj)
    print Browse.script_str()
    print ryw_view.popup_js()
    return True
def delOneSelFunc(meta, calledByVillageSide, dataURL, callBackArg,
                  searchFile = None):

    name = os.getenv("REMOTE_USER")
    if name == '' or name == 'guest':
        return ''
    
    deleteIconStr = """<IMG
SRC="/icons/trash.gif" BORDER=0 title="remove from selection"
onmouseover="this.style.cursor='pointer';"
onClick="delOneSel('%(objstr)s','%(selobj)s')">
"""
    requestIconStr = """<IMG
SRC="/icons/link.gif" BORDER=0 title="add to current selection"
onmouseover="this.style.cursor='pointer';" onClick="reqData('%s',this)">
"""

    editIconStr = """<A
href="%s"><IMG SRC="/icons/quill.gif" BORDER=0
title="edit object attributes"></A>
"""
    
    objID = meta['id']
    version = str(meta['version'])
    objstr = objID + '#' + version
    selobj = callBackArg
    dict = {}
    dict['objstr'] = objstr
    dict['selobj'] = selobj

    editIconStr = editIconStr % ("/cgi-bin/ShowObject.py?objstr=" +
                                 urllib.quote(objstr),)

    answer = (deleteIconStr % dict) + editIconStr + \
             (requestIconStr % (objstr,))

    versionIconStr = Browse.make_all_version_icon_str(meta, searchFile)

    return answer + versionIconStr
Exemplo n.º 5
0
def cancelFunc(meta, calledByVillageSide, dataURL, searchFile=None):
    deleteIconStr = """
<IMG SRC="/icons/trash.gif" BORDER=0 
title="cancel this request" onmouseover="this.style.cursor='pointer';" 
onClick="deleteVilReq('%s')">
"""
    editIconStr = """<A
href="%s"><IMG SRC="/icons/quill.gif" BORDER=0
title="edit object attributes"></A>
"""

    objID = meta['id']
    version = str(meta['version'])
    objstr = objID + '#' + version
    logging.debug('cancelFunc: ' + objstr)

    editIconStr = editIconStr % ("/cgi-bin/ShowObject.py?objstr=" +
                                 urllib.quote(objstr),)

    versionIconStr = Browse.make_all_version_icon_str(meta, searchFile)

    return deleteIconStr % (objstr,) + editIconStr + versionIconStr
def print_title():
    print_header()
    print Browse.script_str()
Exemplo n.º 7
0
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)

Exemplo n.º 8
0
            print("Exiting the program")
            sys.exit()

#----------------
#
# Main algorithm
#
#----------------

#---------------------------------------------------------------
# List of sources was not specified, browse the whole directory
#---------------------------------------------------------------
if r_specified != "None":

    print("Analyzing Fortan sources in: " + r_specified)
    file_paths = Browse.source_paths(r_specified)

#---------------------------------------------
# List of sources was specified, read from it
#---------------------------------------------
else:

    # Get list of objects from source.list
    try:
        src_file = open(s_specified, 'rt')
    except:
        print("File", s_specified, "can't be found!  Exiting")
        sys.exit()

    with src_file:
        for line in src_file:
Exemplo n.º 9
0
def print_header(selectionName):
    print Browse.script_str()
    print '<FONT SIZE=2>Selection <B><I>' + selectionName + ':</I></B></FONT>'
    print '<BR>'
    print """
Exemplo n.º 10
0
 def browse(self):
     Browse.Brow(self)