Giter Club home page Giter Club logo

timetree-exporter's Issues

Error when start_at or end_at is negative

I'm currently trying to convert a calendar and one event has negative values in start_at and end_at.
That breaks the program. Probably should be checked for before using the values.

The error:

 File "C:\Users\_\AppData\Roaming\Python\Python312\Scripts\timetree-exporter.exe\__main__.py", line 4, in <module>
  File "C:\Users\_\AppData\Roaming\Python\Python312\site-packages\timetree_exporter\__main__.py", line 54, in <module>
    iCalEvent = formatter.to_ical()
                ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\_\AppData\Roaming\Python\Python312\site-packages\timetree_exporter\formatter.py", line 147, in to_ical
    event.add("dtstart", self.dtstart)
                         ^^^^^^^^^^^^
  File "C:\Users\_\AppData\Roaming\Python\Python312\site-packages\timetree_exporter\formatter.py", line 107, in dtstart
    return self.get_datetime(is_start_time=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\_\AppData\Roaming\Python\Python312\site-packages\timetree_exporter\formatter.py", line 92, in get_datetime
    datetime.fromtimestamp(
OSError: [Errno 22] Invalid argument

Part of the Object it failed on:

{
  "category": 1,
  "type": 1,
  "author_type": "User",
  "title": "",
  "all_day": true,
  "start_at": -284169600000,
  "start_timezone": "UTC",
  "end_at": -284169600000,
  "end_timezone": "UTC",
  "label_id": 1,
  "recurrences": ["RRULE:FREQ=YEARLY"],
  "alerts": [],
  "attachment": {},
  "like_count": 0,
  "files": [],
}

If you want, I can do pr for this.

Error

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Python312\Scripts\timetree-exporter.exe\__main__.py", line 4, in <module> ImportError: cannot import name 'main' from 'timetree_exporter.__main__' (C:\Python312\Lib\site-packages\timetree_exporter\__main__.py)
What is the Problem?

JSONDecodeError

Hi all,

I tried to export my TimeTree calendar via timetree-exporter. So I downloaded it on my MacBook Pro via pip3 and created the .json files out of the "sync" answers via dev tools in Microsoft Edge.

Now, when I tree to run the timetree-exporter tool, it tells me the following error:
xxx@xxx bin % ./timetree-exporter /Users/xxx/Desktop/response1.json
2024-06-12 10:00:24 [INFO] Parsing /Users/xxx/Desktop/response1.json
Traceback (most recent call last):
File "/Users/xxx/Library/Python/3.9/bin/./timetree-exporter", line 8, in
sys.exit(main())
File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/timetree_exporter/main.py", line 63, in main
events = get_events_from_file(filename)
File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/timetree_exporter/utils.py", line 16, in get_events_from_file
response_data = json.load(response_file)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/init.py", line 293, in load
return loads(fp.read(),
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

I checked my json file and tried to add double quotes to the value in line 1 column 2, not working. What else can I do?

Thanks in advance!
Marius

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.