예제 #1
0
    def setUp(self):
        Registry.load_default_settings()

        s = Registry.getSchema("org.pybliographer/pubmed/0.1")
        fmt = Store.get("memory")

        self.db = fmt.dbcreate(None, s)
예제 #2
0
    def testSimple(self):
        Registry.load_default_settings()

        source = pybut.src('ut_bst', 'abbrv.bst')
        o = BST.BST(open(source))

        db = Store.get('memory').dbcreate(
            None, Registry.getSchema('org.pybliographer/bibtex/0.1'))
        reader = BibTeX.Reader()
        rs = reader.parse(open(pybut.src('ut_bst', 'simple.bib')), db)
        
        state = BST.State(rs, db)
        o.Run(state)

        output = """\
\\begin{thebibliography}{1}

\\bibitem{1}
Frederic Gobry and First Last.
\\newblock This is a title.
\\newblock {\em My journal}, 12(123), 2007.

\\bibitem{2}
Frederic Gobry and First Last.
\\newblock {\em This is a title}.

\\end{thebibliography}
"""
        self.failUnlessEqual(state.output, output)
예제 #3
0
    def setUp(self):
        Registry.load_default_settings()

        s = Registry.getSchema("org.pybliographer/pubmed/0.1")
        fmt = Store.get("memory")

        self.db = fmt.dbcreate(None, s)

        self.cnx = PubMed(self.db)
        self.port = reactor.listenTCP(8000, Server())
예제 #4
0
    def setUp(self):
        Registry.load_default_settings()

        s = Registry.getSchema("org.pybliographer/wok/0.1")
        fmt = Store.get("memory")

        self.db = fmt.dbcreate(None, s)

        self.cnx = WOK.WOK(self.db)
        self.port = reactor.listenTCP(8000, Server())

        self.cnx.baseURL = "http://localhost:8000/esti"
        return
예제 #5
0
    def setUp(self):
        Registry.load_default_settings()

        s = Registry.getSchema('org.pybliographer/crossref/0.1')
        fmt = Store.get('memory')

        self.db = fmt.dbcreate(None, s)

        self.cnx = CrossRef.DOIQuery(self.db, 'user', 'pass')
        self.cnx.baseURL = 'http://localhost:8000/query'
        
        self.port = reactor.listenTCP(8000, Server())
        return
예제 #6
0
 def setUp(self):
     Registry.load_default_settings()
예제 #7
0
   python wok.py 'Author=(Gobry)' gobry.bip

"""

import sys

from twisted.internet import reactor

from Pyblio import Registry, Store
from Pyblio.External import WOK

query, output = sys.argv[1:]

# Create a database that is capable of storing Web of Science results.
Registry.load_default_settings()

s = Registry.getSchema('org.pybliographer/wok/0.1')
fmt = Store.get('file')

db = fmt.dbcreate(output, s)

# Initialize the connection to the database
wok = WOK.WOK(db)

# Perform a search. In return, we obtain the result set that will be
# filled in with the results, and a deferred that will fire once the
# query is over.
d, rs = wok.search(query)

def success(total):