Merge remote branch 'cbenz/master'
This commit is contained in:
commit
9189161c39
7 changed files with 61 additions and 68 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,3 +4,4 @@
|
|||
Session.vim
|
||||
build
|
||||
dist
|
||||
*.egg-info
|
||||
|
|
|
|||
71
INSTALL
71
INSTALL
|
|
@ -1,64 +1,35 @@
|
|||
Weboob installation
|
||||
===================
|
||||
|
||||
Like any Python package using setuptools, Weboob can be installed:
|
||||
* from eggs
|
||||
* from Debian packages
|
||||
* from setup.py in install mode or in development mode
|
||||
Like any Python package using setuptools, Weboob can be installed in install
|
||||
mode or in development mode.
|
||||
|
||||
|
||||
From Eggs
|
||||
---------
|
||||
Install mode
|
||||
------------
|
||||
|
||||
Weboob is distributed using many packages. There is one package for the core
|
||||
library, many packages for backends (grouped by capabilities), and one package
|
||||
for each application.
|
||||
The install mode copies files to the Python system-wide packages directory
|
||||
(for example /usr/lib/python2.5/site-packages for Python 2.5,
|
||||
or /usr/local/lib/python2.6/dist-packages for Python 2.6)
|
||||
|
||||
To install:
|
||||
TODO: no packages released for the moment
|
||||
|
||||
To uninstall:
|
||||
TODO: no packages released for the moment
|
||||
|
||||
|
||||
From Debian packages
|
||||
--------------------
|
||||
|
||||
Install from the Weboob repository:
|
||||
TODO: no Debian repository exists
|
||||
|
||||
For developers: build yourself Debian packages using
|
||||
$ ./tools/packaging/create_debian_packages.sh
|
||||
|
||||
|
||||
From setup.py
|
||||
-------------
|
||||
|
||||
The install mode copies files to /usr/lib/python2.5/site-packages
|
||||
or /usr/local/lib/python2.6/dist-packages
|
||||
|
||||
The development mode doesn't copy files, but it creates an egg-link
|
||||
which points to the development directory.
|
||||
It is useful for development when files often change.
|
||||
|
||||
# ./setup.py develop
|
||||
Creates /usr/lib/python2.5/site-packages/weboob_dev.egg-link
|
||||
or /usr/local/lib/python2.6/dist-packages/weboob_dev.egg-link
|
||||
|
||||
If you don't want to install all the dependencies, use the --no-deps option:
|
||||
# ./setup.py develop --no-deps
|
||||
and install dependencies by hand from your distribution packages, or from PyPI
|
||||
using easy_install, or the more modern pip.
|
||||
# ./setup.py install
|
||||
|
||||
Scripts are copied to /usr/bin.
|
||||
|
||||
Since there are many dependencies, when you install from sources,
|
||||
you have to handle them by hand, according to your distribution.
|
||||
If you still want to download them, you can uncomment the dependencies
|
||||
in setup.py
|
||||
|
||||
To uninstall, remove the egg-link and remove the weboob_dev line in
|
||||
/usr/lib/python2.5/site-packages/easy-install.pth
|
||||
or /usr/local/lib/python2.6/dist-packages/easy-install.pth
|
||||
your Python system-wide packages directory.
|
||||
|
||||
|
||||
Bash completion
|
||||
---------------
|
||||
Development mode
|
||||
----------------
|
||||
|
||||
To enable bash completion, just source the tools/weboob_bash_completion
|
||||
file from your ~/.bash_completion file (which is sourced by /etc/bash_completion).
|
||||
The development mode doesn't copy files, but creates an egg-link
|
||||
in the Python system-wide packages directory which points to the development
|
||||
directory. It is useful for development when files often change.
|
||||
|
||||
# ./setup.py develop
|
||||
|
|
|
|||
10
README
10
README
|
|
@ -1,5 +1,8 @@
|
|||
Weboob is a project which provides a core library, backends and applications.
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The core library defines capabilities: features common to various websites. For
|
||||
example, http://www.youtube.com and http://www.dailymotion.com are both videos
|
||||
providers: Weboob defines the “ICapVideo” capability.
|
||||
|
|
@ -18,3 +21,10 @@ The core library provides base classes which help the developer to write
|
|||
backends and applications.
|
||||
|
||||
Weboob is written in Python and is distributed under the GPLv3 license.
|
||||
|
||||
|
||||
Bash completion
|
||||
---------------
|
||||
|
||||
To enable bash completion, just source the tools/weboob_bash_completion
|
||||
file from your ~/.bash_completion file (which is sourced by /etc/bash_completion).
|
||||
|
|
|
|||
30
setup.py
30
setup.py
|
|
@ -40,20 +40,20 @@ setup(
|
|||
packages=find_packages(),
|
||||
scripts=[os.path.join('scripts', script) for script in os.listdir('scripts')],
|
||||
install_requires=[
|
||||
'ClientForm', # python-clientform
|
||||
'elementtidy', # python-elementtidy
|
||||
'FeedParser', # python-feedparser
|
||||
'gdata', # python-gdata
|
||||
'html5lib', # python-html5lib
|
||||
'lxml', # python-lxml
|
||||
'Mako', # python-mako
|
||||
'mechanize', # python-mechanize
|
||||
'PIL', # python-imaging
|
||||
'PyQt', # python-qt4
|
||||
'python-dateutil', # python-dateutil
|
||||
'PyYAML', # python-yaml
|
||||
'Routes', # python-routes
|
||||
'simplejson', # python-simplejson
|
||||
'WebOb', # python-webob
|
||||
# 'ClientForm', # python-clientform
|
||||
# 'elementtidy', # python-elementtidy
|
||||
# 'FeedParser', # python-feedparser
|
||||
# 'gdata', # python-gdata
|
||||
# 'html5lib', # python-html5lib
|
||||
# 'lxml', # python-lxml
|
||||
# 'Mako', # python-mako
|
||||
# 'mechanize', # python-mechanize
|
||||
# 'PIL', # python-imaging
|
||||
# 'PyQt', # python-qt4
|
||||
# 'python-dateutil', # python-dateutil
|
||||
# 'PyYAML', # python-yaml
|
||||
# 'Routes', # python-routes
|
||||
# 'simplejson', # python-simplejson
|
||||
# 'WebOb', # python-webob
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -15,12 +15,16 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
from functools import partial
|
||||
import getpass
|
||||
from inspect import getargspec
|
||||
import logging
|
||||
from optparse import OptionGroup, OptionParser
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from weboob.core import CallErrors
|
||||
|
|
@ -66,11 +70,11 @@ class ConsoleApplication(BaseApplication):
|
|||
results_options = OptionGroup(self._parser, 'Results Options')
|
||||
results_options.add_option('-c', '--condition', help='filter result items to display given a boolean condition')
|
||||
results_options.add_option('-n', '--count', type='int', help='get a maximum number of results (all backends merged)')
|
||||
results_options.add_option('-f', '--formatter', choices=formatters, help='select output formatter (%s)' % u','.join(formatters))
|
||||
results_options.add_option('-s', '--select', help='select result item keys to display (comma separated)')
|
||||
self._parser.add_option_group(results_options)
|
||||
|
||||
formatting_options = OptionGroup(self._parser, 'Formatting Options')
|
||||
formatting_options.add_option('-f', '--formatter', choices=formatters, help='select output formatter (%s)' % u','.join(formatters))
|
||||
formatting_options.add_option('--no-header', dest='no_header', action='store_true', help='do not display header')
|
||||
formatting_options.add_option('--no-keys', dest='no_keys', action='store_true', help='do not display item keys')
|
||||
self._parser.add_option_group(formatting_options)
|
||||
|
|
@ -256,7 +260,12 @@ class ConsoleApplication(BaseApplication):
|
|||
caps = (caps,)
|
||||
caps = iter(cap.__name__ for cap in caps)
|
||||
weboobcfg.command_backends(*caps)
|
||||
logging.error(u'You can configure a backends using the "weboob-config add" command:\nweboob-config add <name> [options..]')
|
||||
logging.error(u'You can configure backends using the "weboob-config add" command:\nweboob-config add <name> [options..]')
|
||||
with open('/dev/null', 'w') as devnull:
|
||||
process = subprocess.Popen(['which', 'weboob-config-qt'], stdout=devnull)
|
||||
return_code = process.wait()
|
||||
if return_code == 0:
|
||||
logging.error(u'You can configure backends using the "weboob-config-qt" GUI, too.')
|
||||
sys.exit(0)
|
||||
|
||||
def parse_id(self, _id):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class TableFormatter(IFormatter):
|
|||
header = None
|
||||
|
||||
def __init__(self, display_keys=True, return_only=False, result_funcname='get_string'):
|
||||
IFormatter.__init__(self, display_keys, return_only)
|
||||
IFormatter.__init__(self, display_keys=display_keys, return_only=return_only)
|
||||
self.result_funcname = result_funcname
|
||||
|
||||
def after_format(self, formatted):
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ class INIConfig(IConfig):
|
|||
def load_section(section):
|
||||
sections = section.split(':')
|
||||
if len(sections) > 1:
|
||||
result = {}
|
||||
for s in sections:
|
||||
values = load_section(s)
|
||||
result[s] = load_section(s)
|
||||
return result
|
||||
else:
|
||||
return {section: dict(self.config.items(section))}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue