annotate make/splitols.py @ 107:dde34eaf03ed

Add 2010 OLS papers.
author Rob Landley <rob@landley.net>
date Sun, 12 Dec 2010 16:49:15 -0600
parents 7bcba6e2acc3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
51
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/usr/bin/python
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
2
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Break up the OLS volumes into individual papers in the ols/$YEAR directories.
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
4
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # usage: splitols.py mirrordir olsdir
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
6
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
7 import os, sys
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
8
104
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
9 if len(sys.argv) != 3:
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
10 print "Usage: splitols.py inpath outpath"
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
11 sys.exit(1)
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
12
51
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
13 inpath=sys.argv[1]
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
14 outpath=sys.argv[2]
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
15
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
16 def splitvolume(infile, outpath, credits, numbers):
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
17 for i in xrange(len(numbers)-1):
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
18 next = int(numbers[i+1])-1
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
19 command="pdftk %s/%s.pdf cat %s-%s 1-1 %s-%s output %s/%s-pages-%s-%s.pdf" % (inpath,infile,numbers[i],next,credits,credits,outpath,infile,numbers[i],next)
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
20 print command
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
21 os.system(command)
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
22
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
23 volumes = ( ("ols2002", "2002", 7, (8, 31, 40, 50, 55, 65, 73, 93, 107, 117, 130, 146, 176, 183, 191, 197, 213, 223, 242, 250, 260, 265, 274, 289, 301, 310, 317, 330, 338, 368, 376, 383, 390, 407, 414, 425, 439, 451, 459, 468, 479, 496, 521, 530, 545, 556, 565, 573, 594, 604, 618, 632)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
24 ("ols2003", "2003", 7, (8, 23, 34, 44, 50, 63, 76, 89, 98, 109, 117, 128, 134, 150, 169, 185, 201, 213, 219, 233, 242, 249, 258, 260, 275, 285, 297, 304, 315, 321, 325, 340, 351, 367, 373, 380, 387, 398, 410, 424, 434, 447, 457, 470, 480, 494, 507, 524, 531)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
25 ("ols2004v1", "2004", 7, (9, 23, 33, 41, 51, 63, 79, 89, 103, 113, 121, 133, 149, 163, 167, 187, 203, 207, 215, 227, 239, 255, 269, 287, 295)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
26 ("ols2004v2", "2004", 7, (9, 15, 25, 31, 43, 61, 71, 75, 81, 85, 95, 105, 117, 139, 163, 175, 181, 195, 209, 225, 239, 251, 261, 271, 287, 297, 307)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
27 ("ols2005v1", "2005", 7, (9, 21, 37, 49, 59, 77, 105, 117, 135, 141, 155, 177, 189, 203, 209, 227, 241, 247, 253, 257, 277, 279, 289, 297, 305, 313, 321, 335, 347)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
28
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
29 ("ols2005v2", "2005", 7, (9, 19, 33, 43, 57, 73, 87, 99, 119, 141, 149, 159, 183, 201, 213, 217, 227, 229, 243, 259, 273, 279, 291, 299, 305, 321)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
30 ("ols2006v1", "2006", 7, (9, 19, 27, 39, 57, 71, 87, 101, 113, 127, 147, 153, 177, 193, 209, 225, 235, 247, 261, 269, 289, 303, 313, 333, 347, 369, 385, 395, 409, 421, 427, 441, 451)),
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
31 ("ols2006v2", "2006", 7, (9, 25, 35, 45, 59, 73, 79, 83, 91, 99, 109, 125, 131, 147, 151, 159, 173, 181, 193, 209, 223, 239, 249, 263, 275, 295, 303, 313, 321, 337, 349, 357, 371, 387, 401, 411, 417, 423, 437)),
71
d74a0e18965b Title and author for 2007v1, and fix an off-by-one error in the split.
Rob Landley <rob@landley.net>
parents: 51
diff changeset
32 ("ols2007v1", "2007", 7, (9, 21, 29, 41, 53, 65, 75, 81, 87, 93, 103, 113, 125, 131, 141, 153, 167, 179, 189, 201, 205, 215, 225, 231, 239, 245, 251, 263, 277, 285, 293, 303, 315)),
97
b1069151f74b Add and split up OLS 2008 papers.
Rob Landley <rob@landley.net>
parents: 71
diff changeset
33 ("ols2007v2", "2007", 7, (9, 21, 35, 45, 59, 65, 71, 79, 87, 97, 107, 119, 127, 135, 145, 151, 161, 173, 179, 187, 201, 209, 223, 229, 235, 245, 253, 261, 273, 285, 297, 305, 311, 319)),
104
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
34 ("ols2008v1", "2008", 7, (9, 19, 31, 39, 53, 63, 77, 85, 101, 107, 113, 123, 129, 135, 137, 143, 151, 163, 173, 183, 193, 197, 211, 219, 229, 239, 253, 263, 275, 285)),
7bcba6e2acc3 OLS papers are up to 2009 now.
Rob Landley <rob@landley.net>
parents: 97
diff changeset
35 ("ols2008v2", "2008", 5, (7, 19, 27, 39, 47, 57, 67, 75, 85, 91, 101, 115, 125, 135, 145, 151, 157, 163, 179, 187, 199, 205, 215, 227, 235, 245, 255, 261, 268)),
107
dde34eaf03ed Add 2010 OLS papers.
Rob Landley <rob@landley.net>
parents: 104
diff changeset
36 ("ols2009", "2009", 7, (9, 19, 29, 39, 47, 55, 61, 69, 79, 87, 95, 101, 111, 123, 131, 141, 149, 159, 169, 185, 191, 201, 209, 221, 235, 239, 251, 263, 275, 287, 297, 303, 311, 319, 331, 340)),
dde34eaf03ed Add 2010 OLS papers.
Rob Landley <rob@landley.net>
parents: 104
diff changeset
37 ("ols2010", "2010", 7, (9, 19, 33, 35, 41, 43, 45, 57, 63, 75, 83, 91, 101, 109, 121, 133, 147, 153, 155, 159, 173, 175, 177, 189, 197, 207, 217, 225, 231, 245, 255, 263, 265))
97
b1069151f74b Add and split up OLS 2008 papers.
Rob Landley <rob@landley.net>
parents: 71
diff changeset
38 )
51
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
39
93c68f362860 New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
diff changeset
40 for i in volumes: splitvolume(i[0],"%s/%s" % (outpath,i[1]),i[2],i[3])