Coder Social home page Coder Social logo

Tagging with date_format about greg HOT 4 OPEN

manolomartinez avatar manolomartinez commented on June 7, 2024
Tagging with date_format

from greg.

Comments (4)

manolomartinez avatar manolomartinez commented on June 7, 2024

Hi, thanks for your report. You were right and I was wrong. It should be

date_format = %%Y%%m%%d

to avoid interpolation errors, of course. Changing this in the config file, this seems to work in my tests. What is the problem you are seeing?

Manolo

from greg.

jstagge avatar jstagge commented on June 7, 2024

You are correct, this does work. My problem was the config setting:
tag_date = {date}
which throws the following error:
/usr/lib/python3.5/site-packages/stagger/tags.py:711: FrameWarning: TSOA: Ignoring incompatible frame
FrameWarning)
/usr/lib/python3.5/site-packages/stagger/tags.py:711: FrameWarning: TSOP: Ignoring incompatible frame
FrameWarning)
Traceback (most recent call last):
File "/usr/bin/greg", line 11, in
load_entry_point('Greg==0.4.7', 'console_scripts', 'greg')()
File "/usr/lib/python3.5/site-packages/greg/parser.py", line 138, in main
function(vars(args))
File "/usr/lib/python3.5/site-packages/greg/commands.py", line 176, in sync
downloaded = feed.download_entry(entry)
File "/usr/lib/python3.5/site-packages/greg/classes.py", line 331, in download_entry
aux.tag(placeholders)
File "/usr/lib/python3.5/site-packages/greg/aux_functions.py", line 198, in tag
stagger.util.set_frames(podpath, {tag: metadata})
File "/usr/lib/python3.5/site-packages/stagger/util.py", line 103, in set_frames
setattr(tag, key, value)
File "/usr/lib/python3.5/site-packages/stagger/tags.py", line 863, in date
self._validate_friendly_date(value)
File "/usr/lib/python3.5/site-packages/stagger/tags.py", line 450, in _validate_friendly_date
raise ValueError("date must be in 'YYYY-MM-DD HH:MM:SS' format")
ValueError: date must be in 'YYYY-MM-DD HH:MM:SS' format

So, this is a very minor issue caused by trying to tag with a modified date/time.

from greg.

manolomartinez avatar manolomartinez commented on June 7, 2024

Right, so the issue here is that, once you modify the date format, stagger complains, isn't it?
I can see how this is a nuisance.

One possible solution is to have a {date_stagger} placeholder that keeps the date in the format expected by stagger. It looks a bit clunky, perhaps. Other options?

from greg.

jstagge avatar jstagge commented on June 7, 2024

For my purposes, I am happy to not include the
tag_date = {date}

I think your solution makes the most sense. This is far from a critical item, but maybe could be introduced in the future.

from greg.

Related Issues (20)

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.