core: removed pyfeed and xe dependencies:

pyfeed and xe where still used only for date format handling, and there is already dateutil which is a dependency of Wokkel.
    Furthermore pyfeed and xe are still not on pypi, causing troubles for installation with pip
This commit is contained in:
Goffi 2016-04-17 17:08:12 +02:00
commit 06663b9571
7 changed files with 11 additions and 20 deletions

View file

@ -5,17 +5,13 @@ Below is are installation instructions, but please check the wiki which may be m
You can automatically install SàT and its dependencies using easy_install or pip. You will however need to install Python's headers (needed to build some packages), WxPython which is available in most Gnu/Linux distributions, PyGObject and developments version of libxml2 and libxslt (to compile lxml python library).
NOTE: pyfeed and xe are mandatory dependencies, they should be on http://pypi.python.org (PYthon Package Index, the official repository for Python projects) and so being automatically installed; but they are not yet there (their author should do it soon), so you have to install them manually until then.
You can download them respectively on http://home.avvanta.com/%7Esteveha/pyfeed-0.7.4.tar.gz and http://home.avvanta.com/%7Esteveha/xe-0.7.4.tar.gz, then decompress them and do « python setup.py install » on both.
An other way is to use the (insecure) pip options --process-dependency-links and --allow-all-external when installing sat, options which will soon be (or already are) removed from pip.
The environment variable SAT_INSTALL customises the installation, it contains flags separated by spaces:
- "nopreinstall" skips all preinstallation checks
- "autodeb" automatically installs missing packages on Debian-based distributions
- "nox" disables installation of X-based packages (WxWidgets), this is useful for servers
WxPython and PyGobject are automatically installed on Debian-based distributions if "autodeb" option is set. Indeed, on Debian-based distribution, you can type (with the root account):
PyGobject is automatically installed on Debian-based distributions if "autodeb" option is set. Indeed, on Debian-based distribution, you can type (with the root account):
# apt-get install python-pip python-dev libxml2-dev libxslt-dev
# SAT_INSTALL=autodeb pip install .

3
README
View file

@ -105,9 +105,6 @@ Primitivus is based on Urwid (http://excess.org/urwid/) which saved me a lot of
Pyjamas:
Libervia is built with a Pyjamas (http://pyjs.org), a Google Web Toolkit port for python, including Python to Javascript compiler, and Pyjamas Desktop which allow to execute the same application on the desktop or through a browser. It's really an amazing tool.
Pyfeed and Xe:
SàT core and Libervia use pyfeed and xe (http://home.avvanta.com/%7Esteveha/pyfeed.html), 2 libraries made Steve R. Hastings really useful to parse/generate xml stuff as atom feeds.
lxml(http://lxml.de/):
this powerful and efficient XML parsing module is used sometimes to replace Twisted internal tools: its API is handy, and it have some features like evil content cleaning.

View file

@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
from feed.atom import Content
def getURLParams(url):

View file

@ -303,7 +303,6 @@ setup(name=NAME,
],
scripts=['frontends/src/jp/jp', 'frontends/src/primitivus/primitivus', ],
zip_safe=False,
dependency_links=['http://home.avvanta.com/%7Esteveha/pyfeed-0.7.4.tar.gz', 'http://home.avvanta.com/%7Esteveha/xe-0.7.4.tar.gz'],
install_requires=['twisted >= 15.2.0', 'wokkel >= 0.7.1', 'progressbar', 'urwid >= 1.2.0', 'urwid-satext >= 0.4.0', 'pyfeed', 'xe', 'mutagen', 'pillow', 'lxml >= 3.1.0', 'pyxdg', 'markdown', 'html2text', 'pycrypto >= 2.6.1', 'python-potr', 'PyOpenSSL'],
install_requires=['twisted >= 15.2.0', 'wokkel >= 0.7.1', 'progressbar', 'urwid >= 1.2.0', 'urwid-satext >= 0.4.0', 'mutagen', 'pillow', 'lxml >= 3.1.0', 'pyxdg', 'markdown', 'html2text', 'pycrypto >= 2.6.1', 'python-potr', 'PyOpenSSL'],
cmdclass={'install': CustomInstall},
)

View file

@ -1,3 +1,3 @@
from core.constants import Const as C
from .core.constants import Const as C
__version__ = C.APP_VERSION

View file

@ -28,16 +28,15 @@ from twisted.python import failure
from sat.core import exceptions
from sat.tools import xml_tools
from sat.tools import sat_defer
from sat.tools import utils
from sat.tools.common import data_format
# XXX: tmp.pubsub is actually use instead of wokkel version
from wokkel import pubsub
try:
from feed.date import rfc3339
except ImportError:
raise exceptions.MissingModule(u"Missing module pyfeed, please download/install it from http://home.avvanta.com/~steveha/pyfeed.html")
import uuid
import time
import dateutil
import calendar
import urlparse
NS_MICROBLOG = 'urn:xmpp:microblog:0'
@ -252,13 +251,13 @@ class XEP_0277(object):
except StopIteration:
msg = u'No atom updated element found in the pubsub item {}'.format(id_)
raise failure.Failure(exceptions.DataError(msg))
microblog_data[u'updated'] = unicode(rfc3339.tf_from_timestamp(unicode(updated_elt)))
microblog_data[u'updated'] = unicode(calendar.timegm(dateutil.parser.parse(unicode(updated_elt)).utctimetuple()))
try:
published_elt = entry_elt.elements(NS_ATOM, 'published').next()
except StopIteration:
microblog_data[u'published'] = microblog_data[u'updated']
else:
microblog_data[u'published'] = unicode(rfc3339.tf_from_timestamp(unicode(published_elt)))
microblog_data[u'published'] = unicode(calendar.timegm(dateutil.parser.parse(unicode(published_elt)).utctimetuple()))
# links
for link_elt in entry_elt.elements(NS_ATOM, 'link'):
@ -421,9 +420,9 @@ class XEP_0277(object):
## published/updated time ##
current_time = time.time()
entry_elt.addElement('updated',
content=rfc3339.timestamp_from_tf(float(data.get('updated', current_time))))
content = utils.xmpp_date(float(data.get('updated', current_time))))
entry_elt.addElement('published',
content=rfc3339.timestamp_from_tf(float(data.get('published', current_time))))
content = utils.xmpp_date(float(data.get('published', current_time))))
## categories ##
for tag in data_format.dict2iter("tag", data):

View file

@ -43,6 +43,7 @@ def xmpp_date(timestamp=None, with_time=True):
"""Return date according to XEP-0082 specification
to avoid reveling the timezone, we always return UTC dates
the string returned by this method is valid with RFC 3339
@param timestamp(None, float): posix timestamp. If None current time will be used
@param with_time(bool): if True include the time
@return(unicode): XEP-0082 formatted date and time