Skip to content

Video editing with Python

Added theme kr for docs. Added embryo of test suite (really an embryo)

Zulkoc02d1520c7e0
diff --git a/.gitignore b/.gitignore
index 5a2209e2..ce8a1f21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
# Packages
*.egg
*.egg-info
+*.tar.gz
dist
build
eggs
diff --git a/docs/_themes/kr/LICENSE b/docs/_themes/kr/LICENSE
new file mode 100755
index 00000000..3d1e04a2
--- /dev/null
+++ b/docs/_themes/kr/LICENSE
@@ -0,0 +1,45 @@
+Modifications:
+
+Copyright (c) 2011 Kenneth Reitz.
+
+
+Original Project:
+
+Copyright (c) 2010 by Armin Ronacher.
+
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms of the theme, with or
+without modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+* The names of the contributors may not be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+We kindly ask you to only use these themes in an unmodified manner just
+for Flask and Flask-related products, not for unrelated projects. If you
+like the visual style and want to use it for your own projects, please
+consider making some larger changes to the themes (such as changing
+font faces, sizes, colors or margins).
+
+THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/docs/_themes/kr/README.md b/docs/_themes/kr/README.md
new file mode 100755
index 00000000..91f0d6dc
--- /dev/null
+++ b/docs/_themes/kr/README.md
@@ -0,0 +1,25 @@
+krTheme Sphinx Style
+====================
+
+This repository contains sphinx styles Kenneth Reitz uses in most of
+his projects. It is a derivative of Mitsuhiko's themes for Flask and Flask related
+projects. To use this style in your Sphinx documentation, follow
+this guide:
+
+1. put this folder as _themes into your docs folder. Alternatively
+ you can also use git submodules to check out the contents there.
+
+2. add this to your conf.py:
+
+ sys.path.append(os.path.abspath('_themes'))
+ html_theme_path = ['_themes']
+ html_theme = 'kr'
+
+The following themes exist:
+
+**kr**
+ the standard flask documentation theme for large projects
+
+**kr_small**
+ small one-page theme. Intended to be used by very small addon libraries.
+
diff --git a/docs/_themes/kr/autotoc.html b/docs/_themes/kr/autotoc.html
new file mode 100644
index 00000000..c7e8459a
--- /dev/null
+++ b/docs/_themes/kr/autotoc.html
@@ -0,0 +1,35 @@
+
+ <a href="https://twitter.com/share" class="twitter-share-button"
+data-url="http://zulko.github.io/moviepy/"
+data-text="MoviePy - Video Editing with Python"
+data-size="large" data-hashtags="MoviePy">Tweet</a>
+<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
+if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';
+fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
+</script>
+
+<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
+
+
+<ul class="custom-index container"></ul>
+<script type="text/javascript">
+
+$(function() {
+ var ul = $('ul.custom-index');
+ $('dl.class').each(function(i, el) {
+ var name = $('tt.descname', el).html(), id = $('dt', el).attr('id'),
+ li = $('<li><a href="#' + id + '">' + name + '</a></li>');
+ ul.append(li);
+ var ul_ = $('<ul />');
+ li.append(ul_);
+ $('dl.method', el).each(function(i, el) {
+ var name = $('tt.descname', el).html(), id = $('dt', el).attr('id');
+ ul_.append('<li><a href="#' + id + '">' + name + '</a></li>');
+ });
+ });
+
+});
+
+</script>
+
+
diff --git a/docs/_themes/kr/layout.html b/docs/_themes/kr/layout.html
new file mode 100755
index 00000000..44a64fe8
--- /dev/null
+++ b/docs/_themes/kr/layout.html
@@ -0,0 +1,37 @@
+{%- extends "basic/layout.html" %}
+{%- block extrahead %}
+ {{ super() }}
+ <link href="//fonts.googleapis.com/css?family=Open+Sans:400|Antic+Slab" rel="stylesheet" type="text/css">
+ {% if theme_touch_icon %}
+ <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
+ {% endif %}
+ <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
+{% endblock %}
+
+{% block sidebar %}
+
+{% endblock %}
+
+{% block sidebar2 %}
+ {{ sidebar() }}
+{% endblock %}
+
+{% block header %}
+ {{ super() }}
+ {% if pagename == 'index' %}
+<div class=indexwrapper>
+ {% endif %}
+{% endblock %}
+
+{%- block footer %}
+ <div class="footer" style="position:relative">
+ &copy; Copyright {{ copyright }}.
+ </div>
+ <div>
+
+ </div>
+{% if pagename == 'index' %}
+ </div>
+{% endif %}
+
+{%- endblock %}
diff --git a/docs/_themes/kr/relations.html b/docs/_themes/kr/relations.html
new file mode 100755
index 00000000..3bbcde85
--- /dev/null
+++ b/docs/_themes/kr/relations.html
@@ -0,0 +1,19 @@
+<h3>Related Topics</h3>
+<ul>
+ <li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul>
+ {%- for parent in parents %}
+ <li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
+ {%- endfor %}
+ {%- if prev %}
+ <li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
+ }}">{{ prev.title }}</a></li>
+ {%- endif %}
+ {%- if next %}
+ <li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
+ }}">{{ next.title }}</a></li>
+ {%- endif %}
+ {%- for parent in parents %}
+ </ul></li>
+ {%- endfor %}
+ </ul></li>
+</ul>
diff --git a/docs/_themes/kr/sidebarlogo.html b/docs/_themes/kr/sidebarlogo.html
new file mode 100644
index 00000000..4631bebe
--- /dev/null
+++ b/docs/_themes/kr/sidebarlogo.html
@@ -0,0 +1,16 @@
+<a style="border:0" href="index.html"><img src="_static/dataset-logo.png" alt="dataset" /></a>
+
+<p style="font-style:italic;font-size:0.9em; text-align:center; margin-bottom:1.5em">Because managing databases in Python should be as simple as reading and writing JSON files.</p>
+
+<iframe width="200px" scrolling="0" height="20px" frameborder="0" allowtransparency="true" src="http://ghbtns.com/github-btn.html?user=pudo&amp;repo=dataset&amp;type=watch&amp;count=true&amp;size=small"></iframe>
+
+<h3>Overview</h3>
+
+<ul>
+ <li><a href="quickstart.html">Quickstart Guide</a></li>
+ <li><a href="freezefile.html">Freezefiles</a></li>
+ <li><a href="api.html">API documentation</a></li>
+ <li><a href="install.html">Installation</a></li>
+</ul>
+
+
diff --git a/docs/_themes/kr/static/flasky.css_t b/docs/_themes/kr/static/flasky.css_t
new file mode 100755
index 00000000..df9d50f5
--- /dev/null
+++ b/docs/_themes/kr/static/flasky.css_t
@@ -0,0 +1,568 @@
+/*
+ * flasky.css_t
+ * ~~~~~~~~~~~~
+ *
+ * :copyright: Copyright 2010 by Armin Ronacher. Modifications by Kenneth Reitz.
+ * :license: Flask Design License, see LICENSE for details.
+ */
+
+{% set page_width = '940px' %}
+{% set sidebar_width = '220px' %}
+
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- */
+
+body {
+ font-family: "Georgia", "serif", OpenSansRegular, sans-serif;
+ font-size: 17px;
+ background: #fff;
+ font-weight: 400;
+ color: #000;
+ margin: 0;
+ padding: 0;
+}
+
+div.document {
+ width: {{ page_width }};
+ margin: 30px auto 0 auto;
+}
+
+div.documentwrapper {
+ float: left;
+ width: 100%;
+}
+
+div.bodywrapper {
+ margin: 0 0 0 {{ sidebar_width }};
+}
+
+div.sphinxsidebar {
+ width: {{ sidebar_width }};
+}
+
+hr {
+ border: 1px solid #B1B4B6;
+}
+
+div.body {
+ background-color: white;
+ color: #3E4349;
+ padding: 0 30px 0 30px;
+}
+
+img.floatingflask {
+ padding: 0 0 10px 10px;
+ float: right;
+}
+
+div.footer {
+ width: {{ page_width }};
+ margin: 20px auto 30px auto;
+ font-size: 14px;
+ color: #888;
+ text-align: right;
+}
+
+div.footer a {
+ color: #888;
+}
+
+div.related {
+ display: none;
+}
+
+div.sphinxsidebar a {
+ color: #444;
+ text-decoration: none;
+ border-bottom: 1px dotted #999;
+}
+
+div.sphinxsidebar a:hover {
+ border-bottom: 1px solid #999;
+}
+
+div.sphinxsidebar {
+ font-size: 14px;
+ line-height: 1.5;
+}
+
+div.sphinxsidebarwrapper {
+ padding: 18px 10px;
+}
+
+div.sphinxsidebarwrapper p.logo {
+ padding: 0;
+ margin: -10px 0 0 -20px;
+ text-align: center;
+}
+
+div.sphinxsidebar h3,
+div.sphinxsidebar h4 {
+ font-family: 'Antic Slab' ,'Garamond', 'Georgia', serif;
+ color: #000;
+ font-size: 24px;
+ font-weight: normal;
+ margin: 30px 0 5px 0;
+ padding: 0;
+}
+
+div.sphinxsidebar h4 {
+ font-size: 20px;
+}
+
+div.sphinxsidebar h3 a {
+ color: #000;
+}
+
+div.sphinxsidebar p.logo a,
+div.sphinxsidebar h3 a,
+div.sphinxsidebar p.logo a:hover,
+div.sphinxsidebar h3 a:hover {
+ border: none;
+}
+
+div.sphinxsidebar p {
+ color: #555;
+ margin: 10px 0;
+}
+
+div.sphinxsidebar ul {
+ margin: 10px 0px;
+ padding: 0;
+ color: #000;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #ccc;
+ font-family: 'Georgia', serif;
+ font-size: 1em;
+}
+
+/* -- body styles ----------------------------------------------------------- */
+
+a {
+ color: #004B6B;
+ text-decoration: underline;
+}
+
+a:hover {
+ color: #6D4100;
+ text-decoration: underline;
+}
+
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+ font-family: 'Antic Slab', serif;
+ font-weight: normal;
+ margin: 30px 0px 10px 0px;
+ padding: 0;
+ text-shadow: 1px 1px 3px #ddd;
+ color: #000;
+}
+
+
+div.body h1 { margin-top: 0; padding-top: 0; font-size: 250%; }
+div.body h2 { font-size: 190%; }
+div.body h3 { font-size: 160%; }
+div.body h4 { font-size: 140%; }
+div.body h5 { font-size: 110%; }
+div.body h6 { font-size: 110%; }
+
+{% if theme_index_logo %}
+div.indexwrapper h1 {
+ text-indent: -999999px;
+ background: url({{ theme_index_logo }}) no-repeat center center;
+ height: {{ theme_index_logo_height }};
+}
+{% endif %}
+
+a.headerlink {
+ color: #ddd;
+ padding: 0 4px;
+ text-decoration: none;
+}
+
+a.headerlink:hover {
+ color: #444;
+ background: #eaeaea;
+}
+
+div.body p, div.body dd, div.body li {
+ line-height: 1.4em;
+}
+
+div.admonition {
+ background: #fafafa;
+ margin: 20px -30px;
+ padding: 10px 30px;
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+}
+
+div.admonition tt.xref, div.admonition a tt {
+ border-bottom: 1px solid #fafafa;
+}
+
+dd div.admonition {
+ margin-left: -60px;
+ padding-left: 60px;
+}
+
+div.admonition p.admonition-title {
+ font-family: 'Garamond', 'Georgia', serif;
+ font-weight: normal;
+ font-size: 24px;
+ margin: 0 0 10px 0;
+ padding: 0;
+ line-height: 1;
+}
+
+div.admonition p.last {
+ margin-bottom: 0;
+}
+
+div.highlight {
+ background-color: white;
+}
+
+dt:target, .highlight {
+ background: #FAF3E8;
+}
+
+div.note {
+ background-color: #eee;
+ border: 1px solid #ccc;
+}
+
+div.seealso {
+ background-color: #ffc;
+ border: 1px solid #ff6;
+}
+
+div.topic {
+ background-color: #eee;
+}
+
+p.admonition-title {
+ display: inline;
+}
+
+p.admonition-title:after {
+ content: ":";
+}
+
+pre {
+ font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
+ font-size: 0.88em;
+}
+
+tt {
+ font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
+ font-size: 0.95em;
+}
+
+img.screenshot {
+}
+
+tt.descname, tt.descclassname {
+ font-size: 0.95em;
+}
+
+tt.descname {
+ padding-right: 0.08em;
+}
+
+img.screenshot {
+ -moz-box-shadow: 2px 2px 4px #eee;
+ -webkit-box-shadow: 2px 2px 4px #eee;
+ box-shadow: 2px 2px 4px #eee;
+}
+
+table.docutils {
+ border: 1px solid #888;
+ -moz-box-shadow: 2px 2px 4px #eee;
+ -webkit-box-shadow: 2px 2px 4px #eee;
+ box-shadow: 2px 2px 4px #eee;
+}
+
+table.docutils td, table.docutils th {
+ border: 1px solid #888;
+ padding: 0.25em 0.7em;
+}
+
+table.field-list, table.footnote {
+ border: none;
+ -moz-box-shadow: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+
+table.footnote {
+ margin: 15px 0;
+ width: 100%;
+ border: 1px solid #eee;
+ background: #fdfdfd;
+ font-size: 0.9em;
+}
+
+table.footnote + table.footnote {
+ margin-top: -15px;
+ border-top: none;
+}
+
+table.field-list th {
+ padding: 0 0.8em 0 0;
+}
+
+table.field-list td {
+ padding: 0;
+}
+
+table.footnote td.label {
+ width: 0px;
+ padding: 0.3em 0 0.3em 0.5em;
+}
+
+table.footnote td {
+ padding: 0.3em 0.5em;
+}
+
+dl {
+ margin: 0;
+ padding: 0;
+}
+
+dl dd {
+ margin-left: 30px;
+}
+
+blockquote {
+ margin: 0 0 0 30px;
+ padding: 0;
+}
+
+ul, ol {
+ margin: 10px 0 10px 30px;
+ padding: 0;
+}
+
+pre {
+ background: #eee;
+ padding: 7px 30px;
+ margin: 15px -30px;
+ line-height: 1.3em;
+}
+
+dl pre, blockquote pre, li pre {
+ margin-left: 0px;
+ padding-left: 15px;
+}
+
+dl dl pre {
+ margin-left: 0px;
+ padding-left: 15px;
+}
+
+tt {
+ background-color: #ecf0f3;
+ color: #222;
+ /* padding: 1px 2px; */
+}
+
+tt.xref, a tt {
+ background-color: #FBFBFB;
+ color: #2277bb;
+ border-bottom: 1px solid white;
+}
+
+a.reference {
+ text-decoration: none;
+ border-bottom: 1px dotted #004B6B;
+}
+
+a.reference:hover {
+ border-bottom: 1px solid #6D4100;
+}
+
+a.footnote-reference {
+ text-decoration: none;
+ font-size: 0.7em;
+ vertical-align: top;
+ border-bottom: 1px dotted #004B6B;
+}
+
+a.footnote-reference:hover {
+ border-bottom: 1px solid #6D4100;
+}
+
+a:hover tt {
+ background: #EEE;
+}
+
+li {
+ margin-bottom: 0.3em;
+}
+
+
+@media screen and (max-width: 850px) {
+
+ div.sphinxsidebar {
+ display: none;
+ }
+
+ div.document {
+ width: 100%;
+
+ }
+
+ div.documentwrapper {
+ margin-left: 0;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ }
+
+ div.bodywrapper {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ }
+
+ ul {
+ margin-left: 0;
+ }
+
+ .document {
+ width: auto;
+ }
+
+ .footer {
+ width: auto;
+ }
+
+ .bodywrapper {
+ margin: 0;
+ }
+
+ .footer {
+ width: auto;
+ }
+
+ .github {
+ display: none;
+ }
+
+
+
+}
+
+
+
+@media screen and (max-width: 875px) {
+
+ body {
+ margin: 0;
+ padding: 20px 30px;
+ }
+
+ div.documentwrapper {
+ float: none;
+ background: white;
+ }
+
+ div.sphinxsidebar {
+ display: block;
+ float: none;
+ width: 102.5%;
+ margin: 50px -30px -20px -30px;
+ padding: 10px 20px;
+ background: #333;
+ color: white;
+ }
+
+ div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
+ div.sphinxsidebar h3 a {
+ color: white;
+ }
+
+ div.sphinxsidebar a {
+ color: #aaa;
+ }
+
+ div.sphinxsidebar p.logo {
+ display: none;
+ }
+
+ div.document {
+ width: 100%;
+ margin: 0;
+ }
+
+ div.related {
+ display: block;
+ margin: 0;
+ padding: 10px 0 20px 0;
+ }
+
+ div.related ul,
+ div.related ul li {
+ margin: 0;
+ padding: 0;
+ }
+
+ div.footer {
+ display: none;
+ }
+
+ div.bodywrapper {
+ margin: 0;
+ }
+
+ div.body {
+ min-height: 0;
+ padding: 0;
+ }
+
+
+ .rtd_doc_footer {
+ display: none;
+ }
+
+ .document {
+ width: auto;
+ }
+
+ .footer {
+ width: auto;
+ }
+
+ .footer {
+ width: auto;
+ }
+
+ .github {
+ display: none;
+ }
+}
+
+
+/* misc. */
+
+.revsys-inline {
+ display: none!important;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+ width: 140px;
+ padding: 4px 3px;
+}
+
+.highlight .nv {
+ color: #C65D09!important;
+}
diff --git a/docs/_themes/kr/theme.conf b/docs/_themes/kr/theme.conf
new file mode 100755
index 00000000..26b77e51
--- /dev/null
+++ b/docs/_themes/kr/theme.conf
@@ -0,0 +1,9 @@
+[theme]
+inherit = basic
+stylesheet = flasky.css
+pygments_style = flask_theme_support.FlaskyStyle
+
+[options]
+index_logo = 'logo.png'
+index_logo_height = 120px
+github_fork = 'http://github.com/zulko/moviepy'
diff --git a/examples/clips_array.py b/examples/clips_array.py
new file mode 100644
index 00000000..7be07ba9
--- /dev/null
+++ b/examples/clips_array.py
@@ -0,0 +1,3 @@
+from moviepy.editor import *
+
+
diff --git a/tests/test_install.py b/tests/test_install.py
new file mode 100644
index 00000000..578fb465
--- /dev/null
+++ b/tests/test_install.py
@@ -0,0 +1,9 @@
+
+from moviepy.editor import *
+
+W,H = (150,180)
+color_clips_props = [{ 'color':[0,0,255],
+ 'init_pos':[]
+[0,0,255],[0,255,0],[255,0,0]
+red_clip, green_clip, blue_clip = [ColorClip((W,H),color=c)
+ for c in RED, GREEN, BLUE]
diff --git a/tests/tests.py b/tests/tests.py
new file mode 100644
index 00000000..541d08fa
--- /dev/null
+++ b/tests/tests.py
@@ -0,0 +1,12 @@
+"""
+Tests meant to be run with pytest
+"""
+
+import pytest
+
+from moviepy.editor import *
+
+
+def example_video1():
+