davidfischer-ch / pytoolbox Goto Github PK
View Code? Open in Web Editor NEWToolbox for Python scripts.
License: Other
Toolbox for Python scripts.
License: Other
Two options:
And type hint the library
When it make sense (e.g. boolean flags, ...)
Source: https://docs.python.org/3/library/subprocess.html
The recommended approach to invoking subprocesses is to use the run() function for all use cases it can handle. For more advanced use cases, the underlying Popen interface can be used directly.
Integrate code I developed to various modules :
This will allow to cleanup to code and make it more robust (e.g. using forced kwargs).
See #40.
[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
Even if its already proven stable with 100'000 images!
Replace log(number or 1) by log(max(1, number))
Dear David,
I think the way you're managing the sequence number rollover is not correct.
One proposal is:
if delta < 0:
delta = RtpPacket.S_MASK + delta + 1
Kind regards,
Nolwenn
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 + ifec.offset) % RtpPacket.S_MASK ?
the latter check fails when the packet sequence number is 65535
At the moment pytoolbox_runtests.py
is configured as such:
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.
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.
../../../../../../../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
@davidfischer-ch sorry for the dump question, but where can I download file DCM_FEC_2D_6_10.pcap?
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'
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).
Implement develop install test commands for handling the --extra-* arguments
Even if its already proven stable with 100'000 images!
To generate official documentation of the project !
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:
And 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).
PyPy3 : No release found for tensorflow -> Test a subset of pytoolbox
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!
Awaiting for Ubuntu 14.04.
Hi David,
Would you mind letting me know what documents you used for your FEC implementation ?
We are looking into doing this on GStreamer, and hoping to find a freely available
standard to work from.
https://bugzilla.gnome.org/show_bug.cgi?id=789074
Thanks so much,
Aaron
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.