Posts Tagged ‘python’
Python: autocomplete names with tab key [solved]
I learned a python trick that saved me a lot of time when using the interpreter. Just wanted to share it with you. >>> import rlcompleter, readline >>> readline.parse_and_bind("tab:complete") With the above lines you’ll have a unix-like autocomplete for functions. For instance, if you type >>> import os >>> os. And then you press “TAB” [...]
Know mod_python running version [SOLVED]
A friend of mine asked yesterday: how do I get the mod_python version that my site is running? Answer is quite easy! >>> import mod_python >>> print mod_python.version 3.3.1
CDS Invenio: OAI ListRecords from one set
When our records are being harvested via OAI we should notice that some harvesters need a namespace and some others do not. So, what is a namespace? Example: – Namespace setName: uzcds:tesisuzcds:tesis – No-Namespace setName: uzcds:tesistesis Our cds invenio 0.99.1 did NOT have namespace’d setNames. Adding em is a easy task. Adding namespaces to SetName’s [...]
Python & Oracle [SOLVED] ImportError: libclntsh.so.11.1: wrong ELF class: ELFCLASS32
If you are getting a message like this: >>> import cx_Oracle Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: libclntsh.so.11.1: wrong ELF class: ELFCLASS32 It means you are having issues with ELF (Executable and Linkable Format) How to solve em? First, locate the path to libclntsh.so.11.1 (usually in /usr): [root@zaguan importaFHdesdeRoble]# [...]
CDS Invenio: Why does Move_to_Done end not appear in function_log?
If you are familiar with CDS INVENIO and know how websubmit works then you will know that a function_log file exists in the current working directory (aka curdir). If you take a close look at this function_log file you will realise that every function’s in the action (aka act) list logs its start and end [...]
Utilizando ECLIPSE para programar python en entorno git
A modo de chuleta, una vez más, os pongo los pasos necesarios para trabajar con Eclipse, EGit y PyDev. 1. Instalar Eclipse Classic. 2. Iniciar Eclipse, y deberías ver una pantalla similar a: 3. Instalar PyDev desde Eclipse. Para ello, en la pantalla anterior, pulsa sobre la flecha de la derecha. Aparecerá una pantalla de [...]
CDS Invenio: bibrank exceptions [SOLVED]
The problem Our Invenio was spitting exceptions like the following: Forced traceback (most recent call last) File "/usr/lib64/python2.4/site-packages/invenio/bibrank.py", line 150, in task_run_core func_object(key) File "/usr/lib64/python2.4/site-packages/invenio/bibrank_word_indexer.py", line 1210, in word_similarity return word_index(run) File "/usr/lib64/python2.4/site-packages/invenio/bibrank_word_indexer.py", line 839, in word_index update_rnkWORD(options["table"], options["modified_words"]) Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/invenio/bibrank_word_indexer.py", line 1114, in update_rnkWORD Nj[j] = Nj.get(j, 0) + [...]
Python: how do I check the variable type? [solved]
This is a usual question in python forums. How (the hell!) do I check my variable’s type? I am NOT a python-pro, but I have to deal with this language very often, as CDS Invenio is coded using python. Well, I was changing a function and wanted to check the type of a variable… First [...]
CDS-Invenio: Change SBI process – not referred records, restricted fulltext access
These past days I have been talking a lot about CDS-Invenio, websubmit module and Apache’s .htaccess files (part one and two). In this blog you can also find some posts that show how to grant access to fulltexts using CDS-Invenio (refer to part one and part two). In those posts a new websubmit function was [...]
CDS Invenio: usage graphs customization
Introduction CDS Invenio offers the possibility to show some usage graphs of your records. ** Edit: If you want this kind of graphics in your CDS Invenio repository, you should make sure that your etc/invenio-local.conf has the following vars set to ’1′: CFG_BIBRANK_SHOW_DOWNLOAD_GRAPHS_CLIENT_IP_DISTRIBUTION = 1 CFG_BIBRANK_SHOW_DOWNLOAD_GRAPHS = 1 For instance, refer to http://zaguan.unizar.es/record/4162/usage There you [...]