changeset 14:273fc80d9623

v0.5 -> New default service document, uses the GIT sword2 client code
author Marco Fabiani <marco.fabiani@eecs.qmul.ac.uk>
date Fri, 25 May 2012 13:14:05 +0100
parents cc6c7235d08a
children e24aea2d14a4
files README sworduploader.py
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/README	Fri May 18 16:20:04 2012 +0100
+++ b/README	Fri May 25 13:14:05 2012 +0100
@@ -2,7 +2,7 @@
 --------------------
 
 A python script to submit large numbers of files to a SWORD2-compatible repository, specifically DSpace 1.8x.
-Built on the SWORD2 python client library: https://bitbucket.org/beno/python-sword2/overview with modifications.
+Built on the SWORD2 python client library: https://github.com/swordapp/python-client-sword2
 
 -----------------------------------------------
 Source:
@@ -14,7 +14,7 @@
 
 - python 2.X
 
-- sword2 library, with modifications: https://bitbucket.org/marcofabiani/python-sword2/src 
+- sword2 library: https://github.com/swordapp/python-client-sword2
 
 -----------------------------------------------
 Installation:
@@ -50,8 +50,7 @@
   --date DATE           Date of creation (string) (ignored for METS packages).
   --servicedoc DSPACEURL
                         Url of the SWORDv2 service document (default:
-                        http://c4dm.eecs.qmul.ac.uk/smdmrd-
-                        test/swordv2/servicedocument
+                        http://c4dm.eecs.qmul.ac.uk/rdr/swordv2/servicedocument
 
 If the submission is created successfully, it will remain open to be completed
 with the necessary metadata and licenses, using the DSpace web interface. The
--- a/sworduploader.py	Fri May 18 16:20:04 2012 +0100
+++ b/sworduploader.py	Fri May 25 13:14:05 2012 +0100
@@ -11,7 +11,7 @@
 
 - python 2.X
 
-- sword2 library, with modifications: https://bitbucket.org/marcofabiani/python-sword2/src 
+- sword2 library: https://github.com/swordapp/python-client-sword2 
 
 -----------------------------------
   Centre for Digital Music, Queen Mary, University of London
@@ -49,10 +49,10 @@
 parser.add_argument("data", type=str, nargs=1,
                    help="Accepts: METSDSpaceSIP and BagIt packages, simple zip files, directories, single files. NOTE: METSDSpaceSIP packages are only accepted by Collections with a workflow!")
 parser.add_argument("--username", dest="user_name", type=str,nargs=1, help="DSpace username.")
-parser.add_argument("--zip", action="store_true",dest="zip",default=False, help="If \"data\" is a directory, compress it and post it as a single file. The zip file will be saved along with the individual files.")
 parser.add_argument("--title", dest="title", type=str,nargs=1, help="Title (ignored for METS packages).")
 parser.add_argument("--author", dest="author", type=str,nargs="+", help="Author(s) (ignored for METS packages). Accepts multiple entries in the format \"Surname, Name\"")
 parser.add_argument("--date", dest="date", type=str,nargs=1, help="Date of creation (string) (ignored for METS packages).")
+parser.add_argument("--zip", action="store_true",dest="zip",default=False, help="If \"data\" is a directory, compress it and post it as a single file. The zip file will be saved along with the individual files.")
 parser.add_argument("--servicedoc", dest="sd", type=str,nargs=1, help="Url of the SWORDv2 service document (default: http://c4dm.eecs.qmul.ac.uk/smdmrd-test/swordv2/servicedocument")
 
 args = parser.parse_args()
@@ -63,7 +63,7 @@
 	storezip = False
 
 if args.sd == None:
-	sd = "http://c4dm.eecs.qmul.ac.uk/smdmrd-test/swordv2/servicedocument"
+	sd = "http://c4dm.eecs.qmul.ac.uk/rdr/swordv2/servicedocument"
 else:
 	sd = args.sd[0]
 
@@ -108,9 +108,10 @@
 			coll = c.workspaces[0][1][ctr]
 			print ctr+1,":",coll.title
 		# Select a collection to deposit into
-		sel = -1
-		while (sel<=0 or sel>numColl):
-			sel = input("Select a Collection to submit your files into: ")
+		sel = "0"
+		while (not sel.isdigit() or int(sel)<=0 or int(sel)>numColl):
+			sel = raw_input("Select a Collection to submit your files into: ")
+		sel = int(sel)
 		collection = c.workspaces[0][1][sel-1]
 		print "Selected Collection: ",collection.title