karthikraman / panchangam

Computing the Indian calendar/panchangam and festivals using Swiss ephemeris
86 stars 30 forks source link

gen_ics.sh is giving error #2

Closed rajroshi closed 4 years ago

rajroshi commented 6 years ago

Hello,

I was trying to generate ical for Dehradun to use in our Gurukulam website but the command ./gen_ics.sh Dehradun 30:19:24 78:04:12 'Asia/Calcutta' 2018 devanagari is giving following error.

Loaded pre-computed panchangam from /home/xxxxx/Documents/Dehradun-2018.json.
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/xxxxx/django-apps/venv/lib/python3.5/site-packages/jyotisha/panchangam/scripts/ics.py", line 268, in <module>
    main()
  File "/home/xxxxx/django-apps/venv/lib/python3.5/site-packages/jyotisha/panchangam/scripts/ics.py", line 263, in main
    ics_calendar = compute_calendar(panchangam)
  File "/home/xxxxx/django-apps/venv/lib/python3.5/site-packages/jyotisha/panchangam/scripts/ics.py", line 201, in compute_calendar
    jyotisha.custom_transliteration.tr(festival_rules[stext].get('shlokas'), panchangam.script, False) + '\n\n'
  File "/home/xxxxx/django-apps/venv/lib/python3.5/site-packages/jyotisha/custom_transliteration.py", line 39, in tr
    text = text.replace('~', '##~##')  # Simple fix to prevent transliteration of ~
AttributeError: 'NoneType' object has no attribute 'replace'
error!

I am sure that I have installed all the needed packages and dependencies as I am able to generate daily and monthly view as PDF successfully. Although I had to do some minor changes in tex file before it could generate PDF.

Thanks for the helpful package.

karthikraman commented 6 years ago

I will try and fix the bug soon. Meanwhile, here is the ICS file: https://www.dropbox.com/s/jwbabkm95vulne9/Dehradun-2018-devanagari.ics?dl=0

karthikraman commented 6 years ago

I'm not able to recreate the bug. Could you use the old-code branch from jyotisha and run? Apologies for the ugly workaround.

rajroshi commented 6 years ago

It is very helpful package indeed, although not very user-friendly:-).

Thanks for the ICS file for the Dehradun. I will try to use the old-code branch of Jyotisha and then check. You may close the issue as you are not able to recreate the issue. So obviously you cannot fix it.

Thanks again.