!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/doc/python-axiom/examples/   drwxr-xr-x
Free 130.08 GB of 142.11 GB (91.54%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     library.py (3.2 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

import random

from axiom.item import Item
from axiom.attributes import text, timestamp, reference, integer, AND, OR
from axiom.store import Store
from epsilon import extime

_d = extime.Time.fromISO8601TimeAndDate

_books = [
    (u'Heart of Darkness', u'Joseph Conrad', u'0486264645', 80, _d('1990-07-01T00:00:00.000001')),
    (u'The Dark Tower, Book 7', u'Stephen King', u'1880418622', 864, _d('2004-11-21T00:00:00.000001')),
    (u'Guns, Germs, and Steel: The Fates of Human Societies', u'Jared Diamond', u'0393317552', 480, _d('1999-04-01T00:00:00.000001')),
    (u'The Lions of al-Rassan', u'Guy Gavriel Kay', u'0060733497', 528, _d('2005-06-28T00:00:00.000001')),
    ]

_borrowers = [u'Anne', u'Bob', u'Carol', u'Dave']


class Borrower(Item):
    typeName = 'borrower'
    schemaVersion = 1
    name = text(indexed=True)

class Book(Item):
    typeName = 'book'
    schemaVersion = 1

    title = text()
    author = text()
    isbn = text()
    pages = integer()
    datePublished = timestamp()

    lentTo = reference()
    library = reference()

class LendingLibrary(Item):
    typeName = 'lending_library'
    schemaVersion = 1

    name = text()

    def books(self):
        return self.store.query(Book,
                                Book.library == self)

    def getBorrower(self, name):
        for b in self.store.query(Borrower,
                                  Borrower.name == name):
            return b
        b = Borrower(name=name,
                     store=self.store)
        return b

    def initialize(self):
        for title, author, isbn, pages, published in _books:
            b = Book(
                title=title,
                author=author,
                isbn=isbn,
                pages=pages,
                datePublished=published,
                library=self,
                store=self.store)


    def displayBooks(self):
        for book in self.books():
            print book.title,
            if book.lentTo is not None:
                print 'lent to', '['+book.lentTo.name+']'
            else:
                print 'in library'

    def shuffleLending(self):
        for book in self.books():
            if book.lentTo is not None:
                print book.lentTo.name, 'returned', book.title
                book.lentTo = None
        for book in self.books():
            if random.choice([True, False]):
                borrower = random.choice(_borrowers)
                print 'Lending', book.title, 'to', borrower
                book.lentTo = self.getBorrower(borrower)

def main(s):
    for ll in s.query(LendingLibrary):
        print 'found existing library'
        break
    else:
        print 'creating new library'
        ll = LendingLibrary(store=s)
        ll.initialize()
    ll.displayBooks()
    print '***'
    ll.shuffleLending()
    print '---'
    ll.displayBooks()
    print '***'
    ll.shuffleLending()
    print '---'

    print s.count(Book, AND (Book.author == u'Stephen King',
                             Book.title == u'The Lions of al-Rassan'))
    print s.count(Book, OR (Book.author == u'Stephen King',
                            Book.title == u'The Lions of al-Rassan'))


if __name__ == '__main__':
    s = Store('testdb')
    s.transact(main, s)
    s.close()

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0084 ]--