Code Monkey home page Code Monkey logo

pytoolbox's Issues

Support Python 3

Two options:

  • Convert with 2to3
  • Use module six + various in-code refinements

Publish some code that was private

Integrate code I developed to various modules :

  • Add Ansible module
  • Add Git module
  • Add GitLab module
  • Add MkDocs module
  • Add Security module
  • Add Terraform module
  • Other to various modules
  • GitLab CLI (processor & co)

Drop Python 2 support

This will allow to cleanup to code and make it more robust (e.g. using forced kwargs).

Handle ffmpeg bad time values

[2014-03-17 10:17:29,584: ERROR/MainProcess] Task encodebox.tasks.transcode[d909578c-6014-46a7-8d5a-e7449b095153] raised unexpected: ValueError('invalid literal for float(): -577014:-32:-22.-77',)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery-3.1.9-py2.7.egg/celery/app/trace.py", line 238, in trace_task
R = retval = fun(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/celery-3.1.9-py2.7.egg/celery/app/trace.py", line 416, in protected_call
return self.run(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/encodebox-0.5.0_beta-py2.7.egg/encodebox/tasks.py", line 89, in transcode
for statistics in encoder_module.encode(transcode_pass[1], transcode_pass[2], transcode_pass[3]):
File "/usr/local/lib/python2.7/dist-packages/pytoolbox/ffmpeg.py", line 208, in encode
ratio = time_ratio(out_duration, in_duration)
File "/usr/local/lib/python2.7/dist-packages/pytoolbox/datetime.py", line 133, in time_ratio
ratio = total_seconds(numerator) / total_seconds(denominator)
File "/usr/local/lib/python2.7/dist-packages/pytoolbox/datetime.py", line 169, in total_seconds
return float(time)
ValueError: invalid literal for float(): -577014:-32:-22.-77

pytoolbox.network.smpte2022.base : 496

shouldn't the check in base.py for packet.sequence (line 496) be:
if packet.sequence != (fec.snbase + ifec.offset) % (RtpPacket.S_MASK + 1)
instead of
if packet.sequence != (fec.snbase + i
fec.offset) % RtpPacket.S_MASK ?

the latter check fails when the packet sequence number is 65535

Tests : Create a better filter

At the moment pytoolbox_runtests.py is configured as such:

  • django module is ignored : Django complains about not founding settings ...
  • ming module is ignored if python3 : ming is not compatible ...

Actually, the ignore filter is : django.py|schema.py|session.py for python3 and only django.py for python2. This must be improved as schema.py and session.py is not explicitly linked to ming/. However I do not know and don't have time to investigate why a regex does not work.

Windows compat

import grp
import pwd

Doesn't work on Windows.

Refactor fileystem module to be importable on Windows, with the side effect of having less features.

Fix basic Django deprecation warning in django.signals.dispatch

../../../../../../../tmp/.local/lib/python3.8/site-packages/pytoolbox/django/signals/dispatch.py:14
/tmp/.local/lib/python3.8/site-packages/pytoolbox/django/signals/dispatch.py:14: RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement. If you rely on this argument as documentation, you can move the text to a code comment or docstring.
super().init(providing_args, use_caching)
-- Docs: https://docs.pytest.org/en/stable/warnings.html

chown: handle broken symlinks

ebu21516:2013-12-18 15:26:34 INFO juju juju-log.go:66 oscied-orchestra/0: [HOOK] Exiting OrchestraHooks hook config-changed
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK Traceback (most recent call last):
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK "main", fname, loader, pkg_name)
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/usr/lib/python2.7/runpy.py", line 72, in run_code
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK exec code in run_globals
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/var/lib/juju/agents/unit-oscied-orchestra-0/charm/library/oscied_lib/OrchestraHooks.py", line 306, in
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK DEFAULT_OS_ENV).trigger()
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/usr/local/lib/python2.7/dist-packages/pytoolbox-6.0.4_beta-py2.7.egg/pytoolbox/juju.py", line 540, in trigger
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK getattr(self, u'hook
{0}'.format(hook_name.replace(u'-', u'
')))()
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/var/lib/juju/agents/unit-oscied-orchestra-0/charm/library/oscied_lib/OrchestraHooks.py", line 210, in hook_config_changed
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK chown(local_cfg.sites_directory, DAEMON_USER, DAEMON_GROUP, recursive=True)
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK File "/usr/local/lib/python2.7/dist-packages/pytoolbox-6.0.4_beta-py2.7.egg/pytoolbox/filesystem.py", line 263, in chown
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK os.chown(os.path.join(root, filename), uid, gid)
ebu21516:2013-12-18 15:26:34 INFO juju.worker.uniter context.go:255 HOOK OSError: [Errno 2] No such file or directory: '/var/www/webui/medias'

Test compatibility with pathlib.Path

Add tests proving the library behave properly when using pathlib.Path instead of str.
Even use this as a criteria to make it smarter (hint: is_file or is_path automagic default).

Cleanup setup.py

Implement develop install test commands for handling the --extra-* arguments

Bug: FEC reset at sequence wraparound

Thanks for nice software. I use it for some testing and found that the FecGenerator has a bug at sequence number wrap-around.

on_reset() reports

       Media seq=0 is out of sequence (expected 0) : FEC algorithm resetted !

This is due to the line generator.py:208 which reads

        if self._media_sequence and media.sequence == self._media_sequence:

but should read

       if self._media_sequence is not None and media.sequence == self._media_sequence:

Cover Django's related modules with tests

This library is heavily used and tests (integration tests) by the Cloud Transcoding Platform CloudNcode.com and other projects, but this is not an excuse and I must kick my ass to add unit-tests here!

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.