Giter VIP home page Giter VIP logo

cronex's People

Contributors

danbornside avatar ericpruitt avatar xavfernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

cronex's Issues

[Feature Request] Add seconds field

I'd like to add an extra seconds field into this. I'm pretty happy with the ability to use cron-like syntax for scheduling, but I'm running into an environment with required resolution of ~10 seconds. I'd like to keep using cron-like syntax while saving compatibility with old tasks at the same time, instead of running once a minute and sleeping within this minute (I think that's ugly).
If I try to add this by myself, would you be interested in maintaining that code? What would you recommend doing (e.g. add seconds field to date_tuple and implement length checks, add an extra seconds = '*' kind of opt. argument, add a function wrapper, etc?).

CronExpression does not accept <unicode> type

Minimum Code

from cronex import CronExpression
ce = CronExpression(u'* * * * *')

Expected result

Code should run without issue

Observed Result

Raises error as

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.python-virtualenvs/codebase/local/lib/python2.7/site-packages/cronex/__init__.py", line 107, in __init__
    self.string_tab = map(str.upper, [minutes, hours, dom, months, dow])
TypeError: descriptor 'upper' requires a 'str' object but received a 'unicode'

Workaround

Simply convert your unicode to str for the time being

from cronex import CronExpression
ce = CronExpression(u'* * * * *'.encode('utf-8))

If you are unsure if the object is of type unicode or str, you can still use the same method

# `my_string` is defined elsewhere, it is possibly a <unicode> or <str> object
from cronex import CronExpression
ce = CronExpression(my_string.encode('utf-8'))

unit test currently failing

Hello @ericpruitt,

Thanks so much for making this little library. It's very helpful.

I was working on a small missing feature needed to implement support for time jump tracking for the Vixie cron style local time tracking event loop algorithm, where non-wildcard and wildcard job execution changes intelligently in the presence of DST, transitions and most forward and reverse clock skew occurrences.

While I was testing my own changes, I noticed an original UT is failing in the unchanged code. I wanted to see if you could check it for a second so I could be sure the change I'd like to contribute will work properly for everyone.

Thanks,
@megahall

$ ./tests.py
...................F....
======================================================================
FAIL: test_periodics_month (__main__.test_testedmodule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./tests.py", line 116, in test_periodics_month
    self.assertFalse(testex.check_trigger(now_tuple[:5]))
AssertionError: True is not false

----------------------------------------------------------------------
Ran 24 tests in 0.035s

FAILED (failures=1)

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.