Comments (9)
Hi, I am new and would like to work on this one.
What I think is that the function here needs to be changed:
def due(self):
"""
Returns the due date, as a datetime object, if set, or None.
"""
if self.todo.get('due', None) is None:
return None
else:
return self._normalize_datetime(self.todo.decoded('due'))
Am I thinking right?
Also, if yes the what data type should be returned>
from todoman.
Hi, thanks for you interest in todoman!
Sorry but no, that's not the actual place change it. The value returned here is used in a few other places that would break:
- Printing with the
--porcelain
flag, which uses a different time format. - Comparing the date of two
todo
s. (comparing strings like"today"
,"yesterday"
and2017-03-20
doesn't give the expected results).
As a general rule, the Todo
class returns data in machine-friendly types (eg: datetime
, etc) and will be sent back and forth.
The TodoFormatter
class converts Todo
s into something friendly to humans/users and is what you're looking for. Specifically, the format_date
function does this bit (this one does return a string).
from todoman.
Oh! I get it now and am likely to send a PR by "tomorrow" :)
from todoman.
Thanks! Let me know if you have any questions, though in out of town right now and replies might be a little sparse.
from todoman.
Hi @hobarrera
I am having some trouble with todoman:
I have installed all the required packages, configuration file is in place, but everytime I type todo
: A error throws up:
Traceback (most recent call last):
File "/home/im_ishan/Desktop/todoman/todoman_env/bin/todo", line 11, in <module>
sys.exit(cli())
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
return Command.invoke(self, ctx)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/todoman/cli.py", line 117, in cli
ctx.obj['db'] = Database(paths, cache_path)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/todoman/model.py", line 696, in __init__
self.cache = Cache(cache_path)
File "/home/im_ishan/Desktop/todoman/todoman_env/lib/python3.5/site-packages/todoman/model.py", line 366, in __init__
self.conn = sqlite3.connect(self.cache_path)
sqlite3.OperationalError: unable to open database file
Do I need to create the sqlite database manually or am I doing something wrong?
Thank you in advance
from todoman.
Hello @rimshaakhan, that really shouldn't happen. Could you post the output of echo $XDG_CACHE_DIR
on your console and also post your configuration file?
from todoman.
Ah I see, you are using the released version of todoman. We really should make a new release, but for development I recommend cloning the todoman repository, cd
-ing to it, then running this inside of your virtualenv:
pip install -e .
If you change the code in the git repository, you can see the changes immediately without having to reinstall todoman.
from todoman.
Oh Yeah! That worked
Thanks @untitaker
from todoman.
I use exact datetimes in my due dates (and a custom format string in my config), so introducing this will break my workflow because it will obscure the exact time if my event is happening today or tomorrow. See #109
from todoman.
Related Issues (20)
- Docs are filing to build on readthedocs HOT 1
- Docs are filing to build on readthedocs HOT 1
- Docs are filing to build on readthedocs HOT 1
- Navigating tasks with vim keys HOT 6
- todoman 4.3.0 not on pypi HOT 4
- 4.3.0: test_ctrl_c_clears fails HOT 3
- Click repl doesn't show up HOT 2
- categories with diacritics not handled well HOT 5
- Subcommand to get current configuration parameters HOT 1
- Can't run v4.3.2 on Slackware64-15.0 HOT 2
- Please release 4.4.0 at PyPi HOT 2
- Tasks template && time tracking HOT 1
- Flags in config file donβt apply to default commands HOT 1
- crash when creating new todo and reading description from stdin HOT 2
- Show one-line summaries when deleting multiple items
- Remember latest creation
- `todo categories` should show all categories
- Rethink flushing
- Exclude fields in list command HOT 1
- Feature request: Any plans on adding recurring tasks? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from todoman.