Commits

Frederic De Groef  committed 9b80708

removed all reference to the csv converter

  • Participants
  • Parent commits d8ec2fe
  • Branches gehol-2011-2012

Comments (0)

Files changed (3)

File bin/gehol2csv.py

-#!/usr/bin/env python
-
-import argparse
-from gehol import GeholProxy
-from gehol.converters.csvwriter import export_csv
-
-def main():
-    '''Import calendar directly from the ULB webserver and convert the calendar
-    into a CSV file compatible with google calendar
-    this version is used only with the "by course" calendars
-    '''
-    parser = argparse.ArgumentParser(description='Fetch Gehol calendar from the ULB web page and generate a csv file compatible with google calendar.',
-                                     epilog="THIS PROGRAM IS GIVEN AS THIS WITHOUT ANY GARANTEE")
-    #positional argument
-    parser.add_argument('mnemo', nargs='?', default=None)
-
-    #optional arguments
-    parser.add_argument('-s','--server', required=False,
-                        help='server address [http://164.15.72.157:8080]',
-                        default = 'http://164.15.72.157:8080')
-     
-    parser.add_argument('-d', required=False,
-                        help='Monday date in the week 1 [20/09/2010]',
-                        default = '20/09/2010')
-     
-         
-     
-    args = parser.parse_args()
-    if args.mnemo is None:
-        parser.print_help()
-    else:
-        dest_filename = 'agenda_%s.csv' % args.mnemo
-        try:
-            gehol_proxy = GeholProxy(args.server)
-            cal =  gehol_proxy.get_course_calendar(args.mnemo)
-            print 'Saving %s (%d events) to %s' % (args.mnemo, len(cal.events), dest_filename )
-            export_csv(cal.metadata, cal.events, dest_filename, args.d)
-
-        except Exception, inst:
-            print 'problem encountered with \n%s\nNothing saved.\n' % args
-            print type(inst)     # the exception instance
-            print inst.args      # arguments stored in .args
-            print inst           # __str__ allows args to printed directly
-        else:
-            print 'done'
-
-
-if __name__ == '__main__':
-    main()

File examples/test_csv_writer.py

-import sys
-sys.path.append("../src")
-
-from gehol import GeholProxy
-from gehol.converters.csvwriter import export_csv, to_csv
-
-
-if __name__=="__main__":
-    print 'import calendar test --> csv files'
-    all_courses = ['INFOH500','BIMEH404','STATH400', 'COMMB411']
-    host = '164.15.72.157:8080'
-    first_monday = '20/09/2010'
-
-    gehol_proxy = GeholProxy(host)
-
-    for course in all_courses:
-        print "fetching events for course %s" % course
-        cal = gehol_proxy.get_course_calendar(course)
-        dest_filename = 'agenda_%s.csv' % course
-        print "Saving %s events to %s" % (course, dest_filename)
-        csv_string = to_csv(cal.metadata, cal.events, first_monday)
-        export_csv(cal.metadata, cal.events, dest_filename, first_monday)
 setup(name='gehol',
       package_dir={'': 'src'},
       packages=['gehol', 'gehol.converters'],
-      scripts=['bin/gehol2csv.py'],
       version=gehol.__version__,
       
       #PyPI metadata