Code Monkey home page Code Monkey logo

timetree-exporter's Introduction

This is Tsai Fong-Chun's place.

A Bachelor Computer Science & Information Technology Student at National Taiwan Normal University.

timetree-exporter's People

Contributors

dependabot[bot] avatar eoleedi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

timetree-exporter's Issues

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?

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.

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.