Code Monkey home page Code Monkey logo

pytodotxt's People

Stargazers

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

Watchers

 avatar

pytodotxt's Issues

Refactor TodoTxt to decouple from files

TodoTxt currently fulfills two purposes: as the container for Taskss grouped in a file and as the dispatcher to parse Tasks from a file.

These two responsibilities should be split to allow for easier extension.

Extra blank lines when creating todotxt from empty file

It happend when I try to creat a "Todotxt" from a empty file.

This is my test code which based on "examples/adding_task.py"

"""Example how to add a task to an existing todo.txt file"""
import pytodotxt


todotxt = pytodotxt.TodoTxt("todo.txt")
todotxt.parse()

new_task = pytodotxt.Task("(A) Do some more stuff")
todotxt.add(new_task)

todotxt.save()

line_num = 1
for line in todotxt.lines:
    print(f"{line_num}: {line}")
    line_num += 1

Afterthis code run, "todo.txt" is this (one blank line and one task line and one blank line again)


(A) Do some more stuff

And I used Windows 10 and Python 3.10

Provide bare description

Thanks for the library ๐Ÿ˜

I think it would be nice to have a property for the "bare" description, i.e. the description without project, context, and attributes.

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.