!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/share/4Suite/Demos/4RDF/   drwxr-xr-x
Free 5.3 GB of 27.03 GB (19.61%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     basic.py (4.8 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'''
An introduction to 4RDF

If you want to use lower-level APIs, e.g. to create an empty model,
see schema.py
'''
'''
Note: if you get an exception such as

_pg.error: FATAL 1:  user "root" does not exist

Then you may have to change the lines

        from Ft.Rdf.Drivers import Postgres
        #Create the database
        connect = 'pygres_demo'
        Postgres.CreateDb(connect)
        Demo('Postgres', connect, 'pygres_demo')

to something like

        from Ft.Rdf.Drivers import Postgres
        #Create the database
        connect = 'postgres@localhost:5432:pygres_demo'
        Postgres.CreateDb(connect)
        Demo('Postgres', connect, 'pygres_demo')


'''

import sys
from Ft.Lib import Uri
from Ft.Rdf import Util
from Ft.Rdf.RdfsHandler import RdfsConstraintViolation
from Ft.Xml.Domlette import NonvalidatingReader, PrettyPrint


def Demo(model, db):
    #Print triples serialized from the document
    print model.complete(None, None, None)

    #Change the language to french
    from Ft.Rdf import Statement
    #First check the status
    print model.complete('http://www.dlib.org', 'http://purl.org/metadata/dublin_core#Language', None)

    ns = Statement.Statement('http://www.dlib.org', 'http://purl.org/metadata/dublin_core#Language', 'en')
    model.remove(ns)
    #Check again
    print model.complete('http://www.dlib.org', 'http://purl.org/metadata/dublin_core#Language', None)

    ns = Statement.Statement('http://www.dlib.org', 'http://purl.org/metadata/dublin_core#Language', 'fr')
    model.add(ns)
    #Check again
    print model.complete('http://www.dlib.org', 'http://purl.org/metadata/dublin_core#Language', None)

    #Now write it all back out in XML
    from Ft.Rdf.Serializers.Dom import Serializer
    serializer = Serializer()
    outdoc = serializer.serialize(model)
    PrettyPrint(outdoc)

    db.commit()
    return


def MemorySetup():
    #With the memory driver, the model is not persistent
    from Ft.Rdf.Drivers import Memory
    #Note that the name is not significant for the memory driver
    uri = Uri.OsPathToUri('w3c1.rdf', attemptAbsolute=True)
    model, db = Util.DeserializeFromUri(uri, driver=Memory,
                                        dbName='memory_demo', create=True)
    return model, db


#Dbm driver for simple persistence
def DbmSetup():
    from Ft.Rdf.Drivers import Dbm
    #The dbm database name is the name of the DB or DBM file
    #if not Dbm.ExistsDb('mydemo.dbm'):
    #    db = Dbm.CreateDb('mydemo.dbm')
    #else:
    #    db = Dbm.GetDb('mydemo.dbm')
    #db.begin()
    uri = Uri.OsPathToUri('w3c1.rdf', attemptAbsolute=True)
    model, db = Util.DeserializeFromUri(uri, driver=Dbm,
                                        dbName='dbm_demo', create=True)
    return model, db


def SqlSetup(driver, connect, modelName):
    try:
        driver = "Ft.Rdf.Drivers." + driver
        driver_mod = __import__(driver, {}, {}, ["*"])
    except:
        raise SystemExit("Unknown driver '%s'" % driver)

    uri = Uri.OsPathToUri('w3c1.rdf', attemptAbsolute=True)
    model, db = Util.DeserializeFromUri(uri, driver=driver_mod,
                                        dbName=connect, create=1)
    #Set up to use the Postgres database of the given instance name
    #db = driver_mod.GetDb(connect)
    return model, db


if __name__ == '__main__':
    print "Running the demo using the memory driver"
    print "========================================"
    model, db = MemorySetup()
    Demo(model, db)
    print "Demo completed.\n"
    print "Running the demo using the Dbm driver"
    print "====================================="
    model, db = DbmSetup()
    Demo(model, db)
    print "Demo completed.\n"
##    try:
##        print "Attempt to run the demo using the PsycoPG driver"
##        from Ft.Rdf.Drivers import Psyco
##        #Create the database
##        Psyco.CreateDb('dbname=ftrdf_demo', 'demo')
##        Demo('Psyco', 'dbname=ftrdf_demo', 'demo')
##        print "Demo completed\n"
##    except:
##        print "Psyco demo could not be completed.\n"
##    sys.exit(0)
    print "Attempting to run the demo using the Postgres driver"
    print "===================================================="
    try:
        import _pg  # so we can refer to _pg.error below
        from Ft.Rdf.Drivers import Postgres
    except:
        print "Postgres demo could not be completed; PyGreSQL apparently not installed."
    else:
        try:
            #Create the database
            connect = 'pygres_demo'
            #connect = 'rdf:postgres@localhost:5432:pygres_demo'
            #Postgres.CreateDb(connect)
            model, db = SqlSetup('Postgres', connect, 'pygres_demo')
            Demo(model, db)
            print "Demo completed.\n"
        except (Exception, _pg.error), e:
            print "Postgres demo could not be completed.  Reason:\n"
            print e

    print "\nEnd of tests."

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.004 ]--