[Checkins] SVN: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/
amazon_fetch: begin refactoring
Luciano Ramalho
luciano at ramalho.org
Sat Aug 4 16:41:54 EDT 2007
Log message for revision 78587:
amazon_fetch: begin refactoring
Changed:
_U Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/
U Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/amazon_fetch.py
A Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/comp-sci-10.txt
A Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/dummy_server.py
-=-
Property changes on: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch
___________________________________________________________________
Name: svn:ignore
+ *.kpf
*.pyc
amazon_config.py
Modified: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/amazon_fetch.py
===================================================================
--- Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/amazon_fetch.py 2007-08-04 20:27:45 UTC (rev 78586)
+++ Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/amazon_fetch.py 2007-08-04 20:41:54 UTC (rev 78587)
@@ -17,6 +17,9 @@
from StringIO import StringIO
from time import sleep
+# XXX: figure out the best place to put the isbn.py module
+# because it is used by kirbi and kirbifetch
+from isbn import convertISBN13toISBN10
"""
Structure of the AmazonECS XML response:
Added: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/comp-sci-10.txt
===================================================================
--- Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/comp-sci-10.txt (rev 0)
+++ Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/comp-sci-10.txt 2007-08-04 20:41:54 UTC (rev 78587)
@@ -0,0 +1,11 @@
+9780471311980
+9781558607743
+9780471135340
+9780471195726
+9780201400090
+9780471923046
+9780471936084
+9780471942436
+9780471624639
+9780471601753
+
Added: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/dummy_server.py
===================================================================
--- Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/dummy_server.py (rev 0)
+++ Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/dummy_server.py 2007-08-04 20:41:54 UTC (rev 78587)
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+import sys
+from SimpleXMLRPCServer import SimpleXMLRPCServer
+
+PORT = 8080
+
+def list_pending_isbns():
+ return pending
+
+def del_pending_isbns(isbns):
+ deleted = 0
+ for isbn in isbns:
+ if isbn in pending:
+ pending.remove(isbn)
+ deleted += 1
+ return deleted
+
+if __name__=='__main__':
+ if len(sys.argv) != 2:
+ print 'usage: %s <filename>' % sys.argv[0]
+ print ' <filename> names a text file containing'
+ print ' ISBN-13 numbers, one per line'
+ sys.exit()
+
+ pending = file(sys.argv[1]).read().split()
+
+ server = SimpleXMLRPCServer(("localhost", PORT))
+ server.register_introspection_functions()
+
+ server.register_function(list_pending_isbns)
+ server.register_function(del_pending_isbns)
+
+ print 'SimpleXMLRPCServer running on port %s...', PORT
+ server.serve_forever()
+
+
Property changes on: Sandbox/luciano/kirbi/kirbifetch/src/kirbifetch/tests/dummy_server.py
___________________________________________________________________
Name: svn:executable
+ *
More information about the Checkins
mailing list