Commits

yohann gabory  committed aebee81

make the app working with correcting bugs

  • Participants
  • Parent commits 9c7808f

Comments (0)

Files changed (4)

+syntax: glob
+*.pyc
+*~
+upload/*
+week.csv

File application_werk.py

 
 def get_data(mode="a",file="week.csv"):
     """ process an org-agenda to get the data into a csv file """
-    
-    os.system("""
-emacs -batch -l dummy_org_conf -eval '(org-batch-agenda-csv "%s" org-agenda-include-diary t org-agenda-files (quote ("~/upload/")))' > %s"""% (mode,file)
-)
+    command_line = """
+emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv "%s" org-agenda-span (quote week) org-agenda-include-diary t org-agenda-files (quote ("upload/")))' > week.csv"""% (mode) 
+
+    os.system(command_line)
 
 def read_data(file):
     """ read data from a csv file return a well list of well formated entry"""
     return BaseResponse(template.render(
             today = date.today(),
             agenda = agenda,
-            ,
             name="Weekly"
             ),
                         mimetype='text/html'

File templates.py

   </li>
 </ul>
 </div>
-<h1>{{name}} Agenda from:</h1>
-<h2> {{agenda.dates[0].strftime('%a %d %h %Y') }} to {{agenda.dates[-1].strftime('%a %d %h %Y')}}</h2>
+<h1>{{name}} Agenda from: {{agenda.dates[0].strftime('%a %d %h %Y') }} to {{agenda.dates[-1].strftime('%a %d %h %Y')}}</h1>
 
 {% for elem in agenda.dates %}
   <div class="day 
 """
 
 upload_form = """
-<h1>Gimme your org file motherfucker</h1>
+<h1>Select the org file you want to view</h1>
 <form method="post" action="" enctype="multipart/form-data">
   <input type="file" name="org" />
-  <input type='submit' value='take it or leave it' />
+  <input type='submit' value='Go!' />
 </form>
 """
 
 sucess="""
-<h1>Hey well done, you're not as badass as you seem !</h1>
+<h1>Org file uploaded with success, you can now view the agenda</h1>
 <form action="/generate/week/" method="GET">
-<input type="submit" value="Gimme my agenda bastard!">
+<input type="submit" value="View agenda week">
 </form> 
 """

File templates.pyc

Binary file removed.