Skip to content

Commit

Permalink
Clarifications on packaging and installation
Browse files Browse the repository at this point in the history
  • Loading branch information
bortzmeyer committed Dec 10, 2011
1 parent d7d5e9c commit f3e883a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
12 changes: 11 additions & 1 deletion README
Expand Up @@ -17,7 +17,15 @@ This module uses "distribute", which should be compatible with
"setuptools". If it is not present, it is automatically
downloaded. Same thing for the required modules, which are searched on
PyPi and installed. If you prefer to use local versions, be sure to
install them before running setup.py.
install them before running setup.py. Given the awful state of Python
packaging tools (see "Python packaging" by Tarek Ziade in
"Architecture of Open Source Software", Greg Wilson and Amy Brown
<http://www.aosabook.org/en/index.html>), you'll probably have to do
many things by hand. This module requires:

* SimpleTAL <http://www.owlfish.com/software/simpleTAL/>
* FeedParser <http://code.google.com/p/feedparser/> At least version 5 because of
<http://code.google.com/p/feedparser/issues/detail?id=91>

OS-specific notes:

Expand Down Expand Up @@ -46,3 +54,5 @@ The SeenThis API is documented (in French only) in
You can always write me at stephane+seenthis@bortzmeyer.org
My account on SeenThis is "bortzmeyer"
<http://seenthis.net/people/st%C3%A9phane-bortzmeyer>

With patches from Valentin Lorentz <https://github.com/ProgVal/seenthis-python>
15 changes: 14 additions & 1 deletion SeenThis.py
Expand Up @@ -10,6 +10,7 @@
import urllib2
import locale
import base64
import traceback

from FeedParserPlus import FeedParserPlus

Expand Down Expand Up @@ -91,7 +92,19 @@ def get(self, n=None):
self._add_headers(request)
server = urllib2.urlopen(request)
data = server.read()
atom_feed = FeedParserPlus.parse(data) # TODO handle errors
try:
atom_feed = FeedParserPlus.parse(data)
except:
import tempfile
(datafilefd, datafilename) = tempfile.mkstemp(suffix=".atom",
prefix="seenthis_", text=True)
datafile = os.fdopen(datafilefd, 'w')
datafile.write(data)
datafile.close()
print >>sys.stderr, \
"Parsing error of the answer. The data has been saved in %s" % \
datafilename
raise
got = len(atom_feed['entries'])
if got == 0:
over = True
Expand Down
16 changes: 13 additions & 3 deletions setup.py
@@ -1,11 +1,18 @@
#!/usr/bin/env python

# distribute
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup

# distutils
# from distutils.core import setup

# setuptools
# from setuptools import setup

from setuptools import setup, find_packages
setup(name='SeenThis',
version='0.0',
version='0.1',
description='Use the SeenThis API',
long_description='Use the SeenThis API. SeenThis <http://seenthis.net> is a social network mostly targeted towards the exchange of interesting URLs and short-blogging. See the source code and the example scripts for documentation.',
license='BSD',
Expand All @@ -17,6 +24,9 @@
scripts=['seenthis-backup.py', 'seenthis-post.py'],
data_files=[('/usr/local/doc/SeenThis', ['README',]),],
provides=['SeenThis',],
install_requires=['feedparser', 'simpletal'] # TODO: even when simpletal is installed, setup.py tries to download it from PyPi, probably because there is no locally installed egg for it in the Debian package
install_requires=['feedparser'] # TODO: even when simpletal
# is installed, distribute's setup.py tries to download it from PyPi,
# probably because there is no locally installed egg for it in the Debian
# package. The only solution is to install simpletal; by hand.
)
# TODO: add classifiers

0 comments on commit f3e883a

Please sign in to comment.