isaacbernat / pycrastinate Goto Github PK
View Code? Open in Web Editor NEWTODO less, DO more. Keep your code clean without changing the way you code.
TODO less, DO more. Keep your code clean without changing the way you code.
Running under Python 2 I ran into a UnicodeEncodeError in process_result
:
...
2015-07-16 11:24:38.458050 finish pycrastinate module: save_to_file
2015-07-16 11:24:38.458059 start pycrastinate module: process_results
Traceback (most recent call last):
File "/Users/carlton/bin/pycrastinate.py", line 22, in <module>
pycrastinate(sys.argv[1])
File "/Users/carlton/bin/pycrastinate.py", line 18, in pycrastinate
return run(_cfg.pipeline, _cfg.data, _cfg.enclose)
File "/Users/carlton/bin/pycrastinate.py", line 10, in run
OrderedDict(sorted(pipeline.items())).values(), [])
File "/Users/carlton/bin/pycrastinate.py", line 9, in <lambda>
return reduce(lambda results, func: enclose(func, (config, results)),
File "/Users/carlton/Documents/pycrastinate/enclose/print_log.py", line 13, in print_log
results = func(*params)
File "/Users/carlton/Documents/pycrastinate/modules/process_results.py", line 7, in process_results
deque(data, 0)
File "/Users/carlton/Documents/pycrastinate/modules/save_to_file.py", line 12, in save_to_file
for d in data:
File "/Users/carlton/Documents/pycrastinate/modules/print_summary.py", line 2, in print_summary
report = "\n".join(data)
File "/Users/carlton/Documents/pycrastinate/modules/text_summary.py", line 20, in <genexpr>
repeat(el, 1) if isinstance(el, str)
File "/Users/carlton/Documents/pycrastinate/modules/text_summary.py", line 13, in nested_report
str_attrs = [str(el) for el in (line[attr] for attr in col_order)]
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-31: ordinal not in range(128)
So I switched to Python 3 — which runs ok but writes byte strings to the report file:
$ cat report.txt
================================================================================
token > date > email > line_count > file_path > code
Generated at: 2015-07-16 11:27:31.191042
================================================================================
b'TODO'
b'./MY_FILE.PY'
...
(Again, happy to have a look at this but wanted to get it down.)
Hiya,
I'm just getting started with pycrastinate, so maybe I'll resolve this but it looks to me as if config values are not being respected.
"save_to_file": {
"path": "./",
"filename": "report.txt",
"overwrite": True,
},
Leads to:
File "/Users/carlton/Documents/pycrastinate/modules/save_to_file.py", line 10, in save_to_file
raise Exception("'{}' already exists".format(filename))
Exception: 'report.txt' already exists
I'm also not having any luck moving the save location by setting path
.
I'll look into this later — I'm enjoying the early progress for now :-) — but I wanted to get this down.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.