This commit is contained in:
Sanj 2012-01-31 02:12:55 +05:30
parent 9bf0ca4edc
commit b333377993
5 changed files with 310 additions and 183 deletions

1
print/chronoPeople.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -4,13 +4,84 @@ import json
import codecs import codecs
def do(): def do():
data = json.load(open("chronoPrint.json")) data = json.load(open("chronoPeople.json"))
people = json.load(open("people.json"))
i = 1 i = 1
for d in data: for d in data:
d['serial'] = i d['serial'] = i
i += 1 i += 1
d['bios'] = []
for p in d['people']:
if people.has_key(p):
d['bios'].append(people[p])
else:
print "Error: %d, %s" % (d['serial'], p,)
t = Template(open("template.html").read()) t = Template(open("template.html").read())
s = t.render({'files': data}) s = t.render({'files': data})
out = codecs.open("out.html", "w", encoding="utf-8") out = codecs.open("out.html", "w", encoding="utf-8")
out.write(s) out.write(s)
out.close() out.close()
def peoplejson():
f = open("people.txt")
o = ''
for line in f:
o = o + line.strip().replace("\n", "") + ",\n"
out = open("people.json", "w")
d = "{" + o[0:-1] + "}"
print d
out.write(d)
out.close()
# out.write(json.dumps(json.loads(d), indent=2))
# out.close()
def doPersons():
radias = json.load(open("chronoPrint.json"))
people = json.load(open("people.json"))
for r in radias:
r['people'] = []
title = r['title']
for p in people.keys():
if title.find(p) != -1:
r['people'].append(p)
o = open("chronoRadiaPeople.json", "w")
o.write(json.dumps(radias, indent=2))
o.close()
def radiaToChrono():
radias = json.load(open("radiaPeople.json"))
chronos = json.load(open("chronoPrint.json"))
x = 0
for r in radias:
chronos[x]['people'] = radias[x]['people']
x += 1
print x
out = open("chronoPeople.json", "w")
out.write(json.dumps(chronos))
out.close()
def addIndexes():
people = json.load(open("chronoRadiaPeople.json"))
x = 0
short = []
for p in people:
index = x
p['index'] = x
x += 1
if len(p['people']) == 0:
short.append({
'index': index,
'title': p['title'],
'people': []
})
out = open("chronoRadiaPeopleIndexed.json", "w")
out.write(json.dumps(p, indent=2))
out.close()
out2 = open("peopleToBeFixed.json", "w")
out2.write(json.dumps(short, indent=2))
out2.close()

File diff suppressed because it is too large Load Diff

55
print/people.json Normal file
View File

@ -0,0 +1,55 @@
{"Navika Kumar": " Political and Economy Editor, Times Now",
"Rashmi Pratap": "Journalist, Economic Times",
"Rahul Joshi": "Executive Editor, Economic Times and Channel Head, ET NOW",
"Sridharan Ramakrishnan/R. Sridharan": "Senior Editor (News & Trends), ET NOW",
"Jaideep Bose": "Editor-in-Chief, Times of India",
"M.K. Venu": "Managing editor, Financial Express",
"G. Ganapathy Subramaniam": "National Policy Editor, ET NOW and Assistant Editor, Economic Times",
"Shankkar Aiyar": "Managing Editor, India Today",
"Senthil Chengalvarayan": "Managing Editor, CNBC TV 18",
"Rajdeep Sardesai": "Editor-in-chief, CNN-IBN",
"Prabhu Chawla": "Editor-in-chief, The New Indian Express",
"Barkha Dutt": "Group Editor, NDTV",
"Rakesh Hari Pathak": "Economic Bureau Chief, PTI",
"Vir Sanghvi": "Editorial Director, Hindustan Times Group",
"Upender": "Unknown?",
"Surojit": "Unknown?",
"K. Venugopal": "Editor, Hindu Business Line",
"Rajathi Ammal": "Karunanidhi's wife",
"A. Raja": "Former Telecom Minister, DMK",
"Kanimozhi": "Karunanidhi's daughter, DMK",
"N.K. Singh": "IAS and MoP, Rajya Sabha",
"Sunil Arora": "IAS, Ex-Indian Airlines Chairman",
"Rohit Khanna": "Associate Director, Vaishnavi Corporate Communications, (Radia's company)",
"Manoj Warrier": "Executive Director, Vaishnavi Corporate Communications, (Radia's company)",
"Daljeet": "Employee, Vaishnavi Corporate Communications, (Radia's company)",
"Yatish Wahal": "Associate Director, Vaishnavi Advisory Services Pvt.Ltd (Radia's company)",
"Srini": "Employee, Neucomm,(Radia's company)",
"Vishal Mehta": "CEO, Vaishnavi Corporate Communications, (Radia's company)",
"Ratan Tata": "Chairman, Tata Sons, Tata Group",
"Srinath Narasimhan": "CEO, Tata Communications",
"Mr S. Padmanabhan, Paddy": "Executive Director-Operations, Tata Power",
"Noel Tata": "MD, Tata International",
"Venkat": "Executive Secretary to Ratan Tata",
"Shalini Singh": "Head, Corporate Communications, TATA Power",
"Cecilia": "Unknown?",
"Mukesh Ambani": "Chairman & MD - Reliance Industries Ltd.",
"PMS Prasad": "Executive Director, Reliance Industries Ltd.",
"Manoj Modi": "Head of Retail, Reliance Industries Ltd",
"K R Raja": "Chief accountant, Reliance Industries Ltd",
"Tarun Das": "Former Chief, Confederation of Indian Industry (CII)",
"Ranjan Bhattacharya": "Hotelier and Political lobbyist",
"Suhel Seth": "Lobbyist, Counselage India, TV personality",
"R.K. Chandolia": "Personal secretary to A Raja",
"Poongothai Aladi Aruna": "MLA and a minister in Tamil Nadu Government",
"Pradip Baijal": "ex-TRAI chairman, partner in Neosis (Radia's company)",
"Jehangir Pocha": "Chief Editor and part owner, News X",
"Sunil Jain": "Indian Express/Business Standard columnist",
"Manish": "Employee, Bangalore office, Vaishnavi Corporate Communications, (Radia's company)",
"Harinder Singh": "Chairman and MD of Realistic Realtors",
"Sanjay": "Sanjay Chandra of Unitech?",
"Dorai": "Employee Vaishnavi Corporate Communications, (Radia's company)?",
"Baiju Biju": "Unknown?",
"Atul": "Employee Vaishnavi Corporate Communications, (Radia's company)?",
"Madhav": "Unknown?"
}

View File

@ -6,7 +6,7 @@
<body> <body>
{% for f in files %} {% for f in files %}
<div class="fileWrapper"> <div class="fileWrapper">
<h3 class="title"><span class="counter">{{ f.serial }}. </span>{{ f.title }}</h3> <h3 class="title"><span class="counter">{{ f.serial }}. </span>{{ f.title }} <span class="people">{% for person in f.bios %} {{ person }} {% endfor %}</span></h3>
<div class="datetime"> <div class="datetime">
<div class="date">Date: {{ f.dateStr }}</div> <div class="date">Date: {{ f.dateStr }}</div>
<div class="time">Time: {{ f.time }}</div> <div class="time">Time: {{ f.time }}</div>