[Python-modules-commits] [plainbox] 01/07: Import plainbox_0.25.orig.tar.gz

Sylvain Pineau spineau-guest at moszumanska.debian.org
Tue Jan 5 16:48:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

spineau-guest pushed a commit to branch master
in repository plainbox.

commit b8c5efe5af9895823ec50b8e09a9c82302872bb4
Author: Sylvain Pineau <sylvain.pineau at canonical.com>
Date:   Tue Jan 5 17:24:57 2016 +0100

    Import plainbox_0.25.orig.tar.gz
---
 PKG-INFO                                           |   2 +-
 docs/author/index.rst                              |   1 +
 docs/author/qml-job-tutorial.rst                   | 369 +++++++++++++++++++++
 docs/changelog.rst                                 |  10 +
 docs/manpages/plainbox-job-units.rst               |   6 +
 docs/manpages/plainbox-template-units.rst          |   3 +
 plainbox.egg-info/PKG-INFO                         |   2 +-
 plainbox.egg-info/SOURCES.txt                      |   2 +
 plainbox.egg-info/entry_points.txt                 |  42 +--
 plainbox/__init__.py                               |   2 +-
 .../data/plainbox-qml-modules/Plainbox/QmlJob.qml  |   1 +
 plainbox/impl/commands/cmd_startprovider.py        |   8 +-
 plainbox/impl/commands/inv_run.py                  |   8 +
 plainbox/impl/commands/inv_startprovider.py        |  70 ++--
 plainbox/impl/exporter/__init__.py                 |  12 +-
 plainbox/impl/providers/categories/po/es.po        |   4 +-
 plainbox/impl/providers/categories/po/fr.po        |  10 +-
 plainbox/impl/providers/categories/po/pl.po        |   4 +-
 plainbox/impl/providers/categories/po/ug.po        |   4 +-
 plainbox/impl/providers/categories/po/zh_TW.po     |   4 +-
 plainbox/impl/providers/manifest/po/pl.po          |   4 +-
 plainbox/impl/providers/manifest/po/zh_TW.po       |   4 +-
 plainbox/impl/providers/stubbox/po/de.po           |   4 +-
 plainbox/impl/providers/stubbox/po/en_GB.po        |   4 +-
 plainbox/impl/providers/stubbox/po/pl.po           |   4 +-
 plainbox/impl/providers/stubbox/po/pt.po           |   4 +-
 plainbox/impl/providers/stubbox/po/ug.po           |   4 +-
 plainbox/impl/runner.py                            |   8 +-
 plainbox/impl/secure/providers/v1.py               |  36 +-
 plainbox/impl/session/assistant.py                 | 169 +++++++++-
 plainbox/impl/session/restart.py                   | 134 ++++++++
 plainbox/impl/unit/job.py                          |  32 +-
 plainbox/impl/unit/template.py                     |  71 ++--
 plainbox/impl/unit/test_job.py                     |  11 +
 plainbox/impl/unit/testplan.py                     |   1 +
 plainbox/qml_shell/qml_shell.qml                   |   7 +-
 po/de.po                                           |   4 +-
 po/en_AU.po                                        |   4 +-
 po/en_CA.po                                        |   4 +-
 po/en_GB.po                                        |   4 +-
 po/es.po                                           |   4 +-
 po/fr.po                                           |  16 +-
 po/ja.po                                           |   4 +-
 po/pl.po                                           |   4 +-
 po/pt.po                                           |   4 +-
 po/ru.po                                           |   4 +-
 po/tr.po                                           |   4 +-
 po/uk.po                                           |   4 +-
 po/zh_TW.po                                        |   4 +-
 setup.cfg                                          |   2 +-
 setup.py                                           |   2 +-
 51 files changed, 940 insertions(+), 189 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 86968b9..30f7765 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: plainbox
-Version: 0.24
+Version: 0.25
 Summary: Toolkit for software and hardware integration testing
 Home-page: https://launchpad.net/plainbox/
 Author: Zygmunt Krynicki
diff --git a/docs/author/index.rst b/docs/author/index.rst
index b6f9a29..8e213ae 100644
--- a/docs/author/index.rst
+++ b/docs/author/index.rst
@@ -9,6 +9,7 @@ core.
 .. toctree::
    intro.rst
    tutorial.rst
+   qml-job-tutorial.rst
    providers.rst
    whitelists.rst
    rfc822.rst
diff --git a/docs/author/qml-job-tutorial.rst b/docs/author/qml-job-tutorial.rst
new file mode 100644
index 0000000..767867b
--- /dev/null
+++ b/docs/author/qml-job-tutorial.rst
@@ -0,0 +1,369 @@
+========================
+QML-native Jobs Tutorial
+========================
+
+.. contents::
+
+What is a qml-native job
+------------------------
+
+A qml-native job is a simple Qt Quick application (it usually is one .qml file)
+designed to test computer systems as any other plainbox job, difference being
+that it can have fully blown GUI and communicates with checkbox stack using
+predefined interface.
+
+Software requirements
+---------------------
+
+To develop and run qml-native jobs you need two things:
+
+Ubuntu-SDK and Plainbox
+
+Ubuntu-SDK installation
+```````````````````````
+
+To install Ubuntu-SDK just run
+
+``# apt-get install ubuntu-sdk``
+
+Ubuntu-SDK, once opened, will ask you if you want to create any kit.
+
+.. image:: qml-tut-0.png
+ :scale: 100
+ :alt: ubuntu-sdk kit creation wizard.
+
+Go ahead and create one matching the architecture you're running on. And grab
+a coffee, as this may take awhile. If prompted about emulator installation, skip
+the screen.
+
+Plainbox installation
+`````````````````````
+
+add checkbox-dev PPA:
+
+``# apt-add-repository ppa:checkbox-dev/ppa``
+
+retrieve the list of packages:
+
+``# apt-get update``
+
+install latest plainbox
+
+``# apt-get install plainbox``
+
+If you want to work on the greatest and latest of Plainbox, you might want to 
+use trunk version. To do that follow these steps::
+
+    $ bzr checkout --lightweight lp:checkbox
+    $ cd checkbox
+    $ ./mk-venv venv
+    $ . venv/bin/activate
+
+Now you should be able to launch ``plainbox-qml-shell`` command.
+
+First qml-native job - Smoke test
+---------------------------------
+
+Let's build a very basic test that shows pass and fail buttons.  All
+qml-native jobs start as ordinary QtQuick ``Item{}``, with ``testingShell``
+property and testDone signal. I.e. ::
+
+    import QtQuick 2.0
+    Item {
+        property var testingShell;
+         signal testDone(var test);
+    }
+
+That's the boilerplate code every qml-native job will have.
+Now let's add two buttons.::
+
+    import QtQuick 2.0
+    import Ubuntu.Components 0.1
+    Item {
+        property var testingShell;
+        signal testDone(var test);
+        Column {
+            Button {
+                text: "pass"
+                onClicked: testDone({outcome: "pass"})
+            }
+            Button {
+                text: "fail"
+                onClicked: testDone({outcome: "fail"})
+            }
+        }
+    }
+
+Save the above code as ``simple-job.qml``. We will run it in a minute.
+
+``{outcome: "pass"}`` - this code creates an object with one property -
+``outcome`` that is set the value of ``"pass"``.
+
+``testDone({outcome: "pass"})`` -  triggers ``testDone`` signal sending newly
+created object. This informs the governing infrastructure that the test is
+done and the test passed.
+
+
+How to run jobs
+---------------
+
+Now we're ready to test newly developed qml job. Run: ::
+
+    $ plainbox-qml-shell simple-job.qml
+
+.. image:: qml-tut-1.png
+ :scale: 100
+ :alt: ubuntu-sdk kit creation wizard.
+
+It's not the prettiest qml code in the world, but it is a proper qml-native
+plainbox job!
+
+
+Multi-page tests
+----------------
+
+Two common approaches when developing multi-page qml app are flat structure, or
+page navigation using page stack.
+
+Flat page hierarchy
+```````````````````
+
+The simplest way is to create two Page components and switch their visibility
+properties.  E.g.::
+
+    Item {
+        id: root
+        property var testingShell;
+        Page {
+            id: firstPage
+            Button {
+                onClicked: {
+                    firstPage.visible = false;
+                    secondPage.visible = true;
+                }
+            }
+        }
+        Page {
+            id: secondPage
+            visible: false
+        }
+    }
+
+
+Using page stack
+````````````````
+
+``testingShell`` defines ``pageStack`` property that you can use for multi-page
+test with navigation. E.g.::
+
+    Item {
+        id: root
+        property var testingShell;
+        Page {
+            id: firstPage
+            visible: false
+            Button {
+                onClicked: testingShell.pageStack.push(second)
+            }
+        }
+        Page {
+            id: secondPage
+            visible: false
+        }
+        Component.onCompleted: testingShell.pageStack.push(first)
+    }
+
+
+
+Migrating QtQuick app to a qml-native test
+------------------------------------------
+
+Start by creating ordinary "QML App with Simple UI"
+
+.. image:: qml-tut-2.png
+ :scale: 100
+ :alt: ubuntu-sdk kit creation wizard.
+
+The code generated by SDK should look like this:
+
+.. image:: qml-tut-3.png
+ :height: 525
+ :width: 840
+ :alt: ubuntu-sdk kit creation wizard.
+
+Now you can do a typical iterative process of developing an app that should
+have the look and feel of the test you would like to create.
+
+Let's say you're satisfied with the following app::
+
+    import QtQuick 2.0
+    import Ubuntu.Components 1.1
+
+    MainView {
+        useDeprecatedToolbar: false
+
+        width: units.gu(100)
+        height: units.gu(75)
+
+        Page {
+            Column {
+                spacing: units.gu(1)
+                anchors {
+                    margins: units.gu(2)
+                    fill: parent
+                }
+
+                Label {
+                    id: label
+                    text: i18n.tr("4 x 7 = ?")
+                }
+
+                TextField {
+                    id: input
+                }
+
+                Button {
+                    text: i18n.tr("Check")
+
+                    onClicked: {
+                        if (input.text == 28) {
+                            console.log("Correct!");
+                        } else {
+                            console.log("Error!");
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+
+Notice that the app has a ``MainView`` component and one ``Page`` component.
+These are not needed in qml-native jobs, as the view is managed by the testing
+shell.  Also, the outcome of the app is a simple ``console.log()`` statement.
+To convert this app to a proper qml-native job we need to do three things:
+
+ * remove the bits responsible for managing the view
+ * add ``testingShell`` property and the ``testDone`` signal
+ * call ``testDone`` once we have a result
+
+Final result::
+
+    import QtQuick 2.0
+    import Ubuntu.Components 1.1
+    Item {
+        property var testingShell;
+        signal testDone(var test);
+
+        Column {
+            spacing: units.gu(1)
+            anchors {
+                margins: units.gu(2)
+                fill: parent
+            }
+
+            Label {
+                id: label
+                text: i18n.tr("4 x 7 = ?")
+            }
+
+            TextField {
+                id: input
+            }
+
+            Button {
+                text: i18n.tr("Check")
+                onClicked: {
+                    if (input.text == 28) {
+                        testDone({outcome: "pass"});
+                    } else {
+                        testDone({outcome: "fail"});
+                    }
+                }
+            }
+        }
+    }
+
+Plainbox job definition for the test
+````````````````````````````````````
+
+The qml file we've created cannot be considered a plainbox job until it is
+defined as a unit in a plainbox provider.
+
+Consider this definition::
+
+    id: quazi-captcha
+    category_id: Captcha
+    plugin: qml
+    _summary: Basic math captcha
+    _description:
+     This test requires user to do simple multiplication
+    qml_file: simple.qml
+    estimated_duration: 5
+
+Two bits that are different in qml jobs are ``plugin: qml`` and
+``qml_file: simple.qml``
+
+``plugin`` field specifies the type of the plainbox job. The value of `qml`
+informs checkbox applications that this should be run in QML environment
+(testing shell) and ``qml_file`` field specifies which file serves as the entry
+point to the job. The file must be located in the ``data`` directory of the
+provider the job is defined in.
+
+For other information regarding plainbox job units see:
+
+http://plainbox.readthedocs.org/en/latest/manpages/plainbox-job-units.html
+
+To add this job to the plainbox provider with other qml jobs, paste the job
+defintion to:
+``checkbox/providers/2015.com.canonical.certification:qml-tests/units/qml-tests.pxu``
+
+Testing qml job in Checkbox Touch on Ubuntu device
+``````````````````````````````````````````````````
+
+With job definition in qml-tests provider, and the qml file copied to its data
+directory we can build and install checkbox click package.
+In ``checkbox/checkbox-touch`` run::
+
+    ./get-libs
+    ./build-me --provider ../providers/2015.com.canonical.certification\:qml-tests/ \
+    --install
+
+Launch the "Checkbox" app on the device and your test should be live.
+
+Confined Qml jobs
+-----------------
+
+Sometimes there is a need to run a job with a different set of policies.
+Checkbox makes this possible by embedding such jobs into the resulting click
+package as seperate apps. Each of those apps have their own apparmor
+declaration, so each one have its own, seperate entry in the Trust database.
+
+To request Checkbox to run a qml job as confined, add 'confined' flag to its
+definition.
+
+E.g.::
+
+    id: confined-job
+    category_id: confinement-tests
+    plugin: qml
+    _summary: Job that runs as a seperate app
+    _description:
+     Checkbox should run this job with a seperate set of policies.
+    qml_file: simple.qml
+    flags: confined
+    estimated_duration: 5
+
+After the confined jobs are defined, run ``generate-confinement.py`` in the
+root directory of the provider, naming all confined jobs that have been
+declared.
+
+E.g.::
+
+    cd my_provider
+    ~/checkbox/checkbox-touch/confinement/generate-confinement.py confined-job
+
+The tool will print all the hooks declaration you need to add to the
+``manifest.json`` file.
+
+Now, your multi-app click is ready to be built.
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 304dcea..64d07c1 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -11,6 +11,16 @@ ChangeLog
 Plainbox 0.25 (unreleased)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+* `plainbox startprovider` may now be run with an `--empty` option that
+  generates very basic provider that has only `./manage.py` file. Use this
+  option when you know your way around, and you want to quickly start
+  developing plainbox jobs without any other jobs polluting your provider.
+
+* Plainbox now supports a new flag :ref:`explicit-fail
+  <job_flag_explicit_fail>`. Using that flag makes manual failing of the job
+  require a comment to be entered. This flag naturally makes sense only for
+  'manual', 'user-interact-verify', 'user-verify' jobs.
+
 .. _version_0_24:
 
 Plainbox 0.24
diff --git a/docs/manpages/plainbox-job-units.rst b/docs/manpages/plainbox-job-units.rst
index 3e25589..0d5210b 100644
--- a/docs/manpages/plainbox-job-units.rst
+++ b/docs/manpages/plainbox-job-units.rst
@@ -265,6 +265,12 @@ Following fields may be used by the job unit:
         Attach this flag to jobs that cause killing of plainbox process during
         their operation. E.g. run shutdown, reboot, etc.
 
+.. _job_flag_explicit_fail:
+
+    ``explicit-fail``:
+        Use this flag to make entering comment mandatory, when the user
+        manually fails the job.
+
 .. _job_flag_has_leftovers:
 
     ``has-leftovers``:
diff --git a/docs/manpages/plainbox-template-units.rst b/docs/manpages/plainbox-template-units.rst
index f1e69ae..07b1643 100644
--- a/docs/manpages/plainbox-template-units.rst
+++ b/docs/manpages/plainbox-template-units.rst
@@ -77,6 +77,9 @@ the python formatting language. Within each field the record is exposed as the
 variable named by the ``template_resource`` field. Record data is exposed as
 attributes of that object.
 
+The special parameter ``__index__`` can be used to iterate over the devices
+matching the ``template-filter`` field.
+
 Migrating From Local Jobs
 -------------------------
 
diff --git a/plainbox.egg-info/PKG-INFO b/plainbox.egg-info/PKG-INFO
index 86968b9..30f7765 100644
--- a/plainbox.egg-info/PKG-INFO
+++ b/plainbox.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: plainbox
-Version: 0.24
+Version: 0.25
 Summary: Toolkit for software and hardware integration testing
 Home-page: https://launchpad.net/plainbox/
 Author: Zygmunt Krynicki
diff --git a/plainbox.egg-info/SOURCES.txt b/plainbox.egg-info/SOURCES.txt
index 4c72380..b5d8a5f 100644
--- a/plainbox.egg-info/SOURCES.txt
+++ b/plainbox.egg-info/SOURCES.txt
@@ -23,6 +23,7 @@ docs/author/provider-i18n.rst
 docs/author/provider-namespaces.rst
 docs/author/provider-template.rst
 docs/author/providers.rst
+docs/author/qml-job-tutorial.rst
 docs/author/rfc822.rst
 docs/author/tutorial.rst
 docs/author/whitelists.rst
@@ -348,6 +349,7 @@ plainbox/impl/session/__init__.py
 plainbox/impl/session/assistant.py
 plainbox/impl/session/jobs.py
 plainbox/impl/session/manager.py
+plainbox/impl/session/restart.py
 plainbox/impl/session/resume.py
 plainbox/impl/session/state.py
 plainbox/impl/session/storage.py
diff --git a/plainbox.egg-info/entry_points.txt b/plainbox.egg-info/entry_points.txt
index d7de778..9b5083f 100644
--- a/plainbox.egg-info/entry_points.txt
+++ b/plainbox.egg-info/entry_points.txt
@@ -1,34 +1,34 @@
 [console_scripts]
-plainbox = plainbox.public:main
-plainbox-qml-shell = plainbox.qml_shell.qml_shell:main
 plainbox-trusted-launcher-1 = plainbox.impl.secure.launcher1:main
+plainbox = plainbox.public:main
 stubbox = plainbox.impl.box:stubbox_main
+plainbox-qml-shell = plainbox.qml_shell.qml_shell:main
 
-[plainbox.exporter]
-text = plainbox.impl.exporter.text:TextSessionStateExporter
-jinja2 = plainbox.impl.exporter.jinja2:Jinja2SessionStateExporter
-json = plainbox.impl.exporter.json:JSONSessionStateExporter
-xlsx = plainbox.impl.exporter.xlsx:XLSXSessionStateExporter [xlsx]
-rfc822 = plainbox.impl.exporter.rfc822:RFC822SessionStateExporter
+[plainbox.unit]
+unit = plainbox.impl.unit.unit:Unit
+exporter = plainbox.impl.unit.exporter:ExporterUnit
+test plan = plainbox.impl.unit.testplan:TestPlanUnit
+packaging meta-data = plainbox.impl.unit.packaging:PackagingMetaDataUnit
+manifest entry = plainbox.impl.unit.manifest:ManifestEntryUnit
+template = plainbox.impl.unit.template:TemplateUnit
+job = plainbox.impl.unit.job:JobDefinition
+category = plainbox.impl.unit.category:CategoryUnit
 
 [plainbox.buildsystem]
+autotools = plainbox.impl.buildsystems:AutotoolsBuildSystem
 make = plainbox.impl.buildsystems:MakefileBuildSystem
 go = plainbox.impl.buildsystems:GoBuildSystem
-autotools = plainbox.impl.buildsystems:AutotoolsBuildSystem
+
+[plainbox.exporter]
+text = plainbox.impl.exporter.text:TextSessionStateExporter
+rfc822 = plainbox.impl.exporter.rfc822:RFC822SessionStateExporter
+xlsx = plainbox.impl.exporter.xlsx:XLSXSessionStateExporter [xlsx]
+jinja2 = plainbox.impl.exporter.jinja2:Jinja2SessionStateExporter
+json = plainbox.impl.exporter.json:JSONSessionStateExporter
 
 [plainbox.parsers]
-pxu-override = plainbox.impl.xparsers:FieldOverride.parse
+regex = plainbox.impl.xparsers:Re.parse
 whitelist = plainbox.impl.xparsers:WhiteList.parse
 pxu = plainbox.impl.secure.rfc822:load_rfc822_records
-regex = plainbox.impl.xparsers:Re.parse
-
-[plainbox.unit]
-unit = plainbox.impl.unit.unit:Unit
-job = plainbox.impl.unit.job:JobDefinition
-category = plainbox.impl.unit.category:CategoryUnit
-test plan = plainbox.impl.unit.testplan:TestPlanUnit
-exporter = plainbox.impl.unit.exporter:ExporterUnit
-manifest entry = plainbox.impl.unit.manifest:ManifestEntryUnit
-packaging meta-data = plainbox.impl.unit.packaging:PackagingMetaDataUnit
-template = plainbox.impl.unit.template:TemplateUnit
+pxu-override = plainbox.impl.xparsers:FieldOverride.parse
 
diff --git a/plainbox/__init__.py b/plainbox/__init__.py
index 54e73e1..23d2159 100644
--- a/plainbox/__init__.py
+++ b/plainbox/__init__.py
@@ -33,4 +33,4 @@ if sys.version_info[0:2] < (3, 2):
 # PEP386 compliant version declaration.
 #
 # This is used by @public decorator to enforce our public API guarantees.
-__version__ = (0, 24, 0, "final", 0)
+__version__ = (0, 25, 0, "final", 0)
diff --git a/plainbox/data/plainbox-qml-modules/Plainbox/QmlJob.qml b/plainbox/data/plainbox-qml-modules/Plainbox/QmlJob.qml
index 7f4358f..4ea2724 100644
--- a/plainbox/data/plainbox-qml-modules/Plainbox/QmlJob.qml
+++ b/plainbox/data/plainbox-qml-modules/Plainbox/QmlJob.qml
@@ -24,4 +24,5 @@ import Ubuntu.Components 1.1
 Item {
     signal testDone(var testResult)
     property var testingShell;
+    property var clearedPermissions: [];
 }
diff --git a/plainbox/impl/commands/cmd_startprovider.py b/plainbox/impl/commands/cmd_startprovider.py
index cb6069d..a373f09 100644
--- a/plainbox/impl/commands/cmd_startprovider.py
+++ b/plainbox/impl/commands/cmd_startprovider.py
@@ -74,9 +74,11 @@ class StartProviderCommand(PlainBoxCommand):
     def invoked(self, ns):
         from plainbox.impl.commands.inv_startprovider \
             import StartProviderInvocation
-        return StartProviderInvocation(ns.name).run()
+        return StartProviderInvocation(ns).run()
 
     def register_parser(self, subparsers):
+        from plainbox.impl.commands.inv_startprovider \
+            import EmptyProviderSkeleton, ProviderSkeleton
         parser = self.add_subcommand(subparsers)
         parser.prog = 'plainbox startprovider'
         parser.add_argument(
@@ -88,4 +90,8 @@ class StartProviderCommand(PlainBoxCommand):
             # some-name must be a reasonably-ASCII string (should be safe for a
             # portable directory name)
             help=_("provider name, eg: YYYY.example.org:some-name"))
+        parser.add_argument(
+            '--empty', action='store_const', const=EmptyProviderSkeleton,
+            default=ProviderSkeleton, dest='skeleton',
+            help=_('create an empty provider'))
         parser.set_defaults(command=self)
diff --git a/plainbox/impl/commands/inv_run.py b/plainbox/impl/commands/inv_run.py
index f05f249..5fcc829 100644
--- a/plainbox/impl/commands/inv_run.py
+++ b/plainbox/impl/commands/inv_run.py
@@ -929,9 +929,17 @@ class RunInvocation(CheckBoxInvocationMixIn):
                 print("  " + _("comments") + ": {0}".format(
                     self.C.CYAN(result.comments, bright=False)))
             cmd = self._pick_action_cmd(allowed_actions)
+            # let's store new_comment early for verification if comment has
+            # already been added in the current UI step
+            new_comment = ''
             if cmd == 'set-pass':
                 result_builder.outcome = IJobResult.OUTCOME_PASS
             elif cmd == 'set-fail':
+                if 'explicit-fail' in job.get_flag_set() and not new_comment:
+                    new_comment = input(self.C.BLUE(
+                        _('Please enter your comments:') + '\n'))
+                    if new_comment:
+                        result_builder.add_comment(new_comment)
                 result_builder.outcome = IJobResult.OUTCOME_FAIL
             elif cmd == 'set-skip' or cmd is None:
                 result_builder.outcome = IJobResult.OUTCOME_SKIP
diff --git a/plainbox/impl/commands/inv_startprovider.py b/plainbox/impl/commands/inv_startprovider.py
index 9c2383b..e03630f 100644
--- a/plainbox/impl/commands/inv_startprovider.py
+++ b/plainbox/impl/commands/inv_startprovider.py
@@ -137,12 +137,44 @@ class Skeleton(Directory):
                 os.path.join(root, self.name.format(**kwargs)), **kwargs)
 
 
-class ProviderSkeleton(Skeleton):
+class EmptyProviderSkeleton(Skeleton):
+    """Empty provider having only the boilerplate manage.py file."""
+
+    things = []
+
+    things.append(File("manage.py", executable=True, full_text="""
+        #!/usr/bin/env python3
+        from plainbox.provider_manager import setup, N_
+
+        # You can inject other stuff here but please don't go overboard.
+        #
+        # In particular, if you need comprehensive compilation support to get
+        # your bin/ populated then please try to discuss that with us in the
+        # upstream project IRC channel #checkbox on irc.freenode.net.
+
+        # NOTE: one thing that you could do here, that makes a lot of sense,
+        # is to compute version somehow. This may vary depending on the
+        # context of your provider. Future version of PlainBox will offer git,
+        # bzr and mercurial integration using the versiontools library
+        # (optional)
+
+        setup(
+            name={name!r},
+            version="1.0",
+            description=N_("The {name} provider"),
+            gettext_domain="{gettext_domain}",
+        )
+        """))
+
+
+class ProviderSkeleton(EmptyProviderSkeleton):
     """
     A skeleton with various content created for the startprovider command.
     """
 
-    things = []
+    # we're using a copy of empty skeleton's things, so we don't modify
+    # the original one (in EmptyProviderSkeleton)
+    things = EmptyProviderSkeleton.things[:]
 
     units_dir = Directory("units")
     things.append(units_dir)
@@ -467,30 +499,6 @@ class ProviderSkeleton(Skeleton):
              echo "Custom script executed"
              """))
 
-    things.append(File("manage.py", executable=True, full_text="""
-        #!/usr/bin/env python3
-        from plainbox.provider_manager import setup, N_
-
-        # You can inject other stuff here but please don't go overboard.
-        #
-        # In particular, if you need comprehensive compilation support to get
-        # your bin/ populated then please try to discuss that with us in the
-        # upstream project IRC channel #checkbox on irc.freenode.net.
-
-        # NOTE: one thing that you could do here, that makes a lot of sense,
-        # is to compute version somehow. This may vary depending on the
-        # context of your provider. Future version of PlainBox will offer git,
-        # bzr and mercurial integration using the versiontools library
-        # (optional)
-
-        setup(
-            name={name!r},
-            version="1.0",
-            description=N_("The {name} provider"),
-            gettext_domain="{gettext_domain}",
-        )
-        """))
-
     things.append(File(".gitignore", full_text="dist/*.tar.gz\nbuild/mo/*\n"))
 
     things.append(File(".bzrignore", full_text="dist/*.tar.gz\nbuild/mo/*\n"))
@@ -498,13 +506,13 @@ class ProviderSkeleton(Skeleton):
 
 class StartProviderInvocation:
 
-    def __init__(self, name):
-        self.name = name
+    def __init__(self, ns):
+        self.ns = ns
 
     def run(self):
         try:
-            ProviderSkeleton(self.name).instantiate(
-                '.', name=self.name,
-                gettext_domain=re.sub("[.:]", "_", self.name))
+            self.ns.skeleton(self.ns.name).instantiate(
+                '.', name=self.ns.name,
+                gettext_domain=re.sub("[.:]", "_", self.ns.name))
         except SomethingInTheWay as exc:
             raise SystemExit(exc)
diff --git a/plainbox/impl/exporter/__init__.py b/plainbox/impl/exporter/__init__.py
index 8f090a9..7582efd 100644
--- a/plainbox/impl/exporter/__init__.py
+++ b/plainbox/impl/exporter/__init__.py
@@ -31,8 +31,6 @@ from io import RawIOBase
 from logging import getLogger
 import base64
 
-import pkg_resources
-
 from plainbox.i18n import gettext as _
 from plainbox.abc import ISessionStateExporter
 from plainbox.impl import deprecated
@@ -380,4 +378,14 @@ class ByteStringStreamTranslator(RawIOBase):
             object's specified encoding prior to writing.
             :param data: the chunk of data to write.
         """
+        if (self.dest_stream.encoding and
+                self.dest_stream.encoding.lower() != self.encoding.lower()):
+            logger.warning(
+                _("Incorrect stream encoding. Got %s, expected %s. "
+                  " some characters won't be printed"),
+                self.dest_stream.encoding, self.encoding)
+            # fall back to ASCII encoding
+            return self.dest_stream.write(data.decode(
+                'ascii', errors='ignore'))
+
         return self.dest_stream.write(data.decode(self.encoding))
diff --git a/plainbox/impl/providers/categories/po/es.po b/plainbox/impl/providers/categories/po/es.po
index 6f21acb..ae8f281 100644
--- a/plainbox/impl/providers/categories/po/es.po
+++ b/plainbox/impl/providers/categories/po/es.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 "Language: es\n"
 
 #. name
diff --git a/plainbox/impl/providers/categories/po/fr.po b/plainbox/impl/providers/categories/po/fr.po
index 0a09846..3499d99 100644
--- a/plainbox/impl/providers/categories/po/fr.po
+++ b/plainbox/impl/providers/categories/po/fr.po
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: checkbox\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL at ADDRESS>\n"
 "POT-Creation-Date: 2014-12-03 14:32+0100\n"
-"PO-Revision-Date: 2015-10-14 16:31+0000\n"
+"PO-Revision-Date: 2015-11-08 10:49+0000\n"
 "Last-Translator: Anne <anneonyme017 at gmail.com>\n"
 "Language-Team: French <fr at li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-15 05:12+0000\n"
-"X-Generator: Launchpad (build 17812)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/categories.pxu:3
@@ -120,7 +120,7 @@ msgstr "Tests des DEL"
 #. name
 #: ../units/categories.pxu:83
 msgid "Media Card tests"
-msgstr ""
+msgstr "Tests des cartes multimédia"
 
 #. name
 #: ../units/categories.pxu:87
@@ -210,7 +210,7 @@ msgstr "Tests de haut débit mobile"
 #. name
 #: ../units/categories.pxu:155
 msgid "Stress tests"
-msgstr ""
+msgstr "Tests de résistance"
 
 #. name
 #: ../units/categories.pxu:159
diff --git a/plainbox/impl/providers/categories/po/pl.po b/plainbox/impl/providers/categories/po/pl.po
index cd9a956..d904097 100644
--- a/plainbox/impl/providers/categories/po/pl.po
+++ b/plainbox/impl/providers/categories/po/pl.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 "Language: Polish\n"
 
 #. name
diff --git a/plainbox/impl/providers/categories/po/ug.po b/plainbox/impl/providers/categories/po/ug.po
index beed3fb..9cfd154 100644
--- a/plainbox/impl/providers/categories/po/ug.po
+++ b/plainbox/impl/providers/categories/po/ug.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-29 05:09+0000\n"
-"X-Generator: Launchpad (build 17837)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/categories.pxu:3
diff --git a/plainbox/impl/providers/categories/po/zh_TW.po b/plainbox/impl/providers/categories/po/zh_TW.po
index b39498d..5091be1 100644
--- a/plainbox/impl/providers/categories/po/zh_TW.po
+++ b/plainbox/impl/providers/categories/po/zh_TW.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-31 05:06+0000\n"
-"X-Generator: Launchpad (build 17838)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/categories.pxu:3
diff --git a/plainbox/impl/providers/manifest/po/pl.po b/plainbox/impl/providers/manifest/po/pl.po
index 9d3e446..afab66e 100644
--- a/plainbox/impl/providers/manifest/po/pl.po
+++ b/plainbox/impl/providers/manifest/po/pl.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 "Language: \n"
 
 #. summary
diff --git a/plainbox/impl/providers/manifest/po/zh_TW.po b/plainbox/impl/providers/manifest/po/zh_TW.po
index 7652714..bdb12fc 100644
--- a/plainbox/impl/providers/manifest/po/zh_TW.po
+++ b/plainbox/impl/providers/manifest/po/zh_TW.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-15 05:12+0000\n"
-"X-Generator: Launchpad (build 17812)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. summary
 #: ../units/manifest.pxu:3
diff --git a/plainbox/impl/providers/stubbox/po/de.po b/plainbox/impl/providers/stubbox/po/de.po
index 7596d97..699f819 100644
--- a/plainbox/impl/providers/stubbox/po/de.po
+++ b/plainbox/impl/providers/stubbox/po/de.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/jobs/categories.pxu:3
diff --git a/plainbox/impl/providers/stubbox/po/en_GB.po b/plainbox/impl/providers/stubbox/po/en_GB.po
index 09b87f3..38110b7 100644
--- a/plainbox/impl/providers/stubbox/po/en_GB.po
+++ b/plainbox/impl/providers/stubbox/po/en_GB.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/jobs/categories.pxu:3
diff --git a/plainbox/impl/providers/stubbox/po/pl.po b/plainbox/impl/providers/stubbox/po/pl.po
index c908713..22ff19b 100644
--- a/plainbox/impl/providers/stubbox/po/pl.po
+++ b/plainbox/impl/providers/stubbox/po/pl.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 "Language: Polish\n"
 
 #. name
diff --git a/plainbox/impl/providers/stubbox/po/pt.po b/plainbox/impl/providers/stubbox/po/pt.po
index 7a81905..1c1b52c 100644
--- a/plainbox/impl/providers/stubbox/po/pt.po
+++ b/plainbox/impl/providers/stubbox/po/pt.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-02 05:11+0000\n"
-"X-Generator: Launchpad (build 17783)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
+"X-Generator: Launchpad (build 17850)\n"
 
 #. name
 #: ../units/jobs/categories.pxu:3
diff --git a/plainbox/impl/providers/stubbox/po/ug.po b/plainbox/impl/providers/stubbox/po/ug.po
index 0961920..ec748ed 100644
--- a/plainbox/impl/providers/stubbox/po/ug.po
+++ b/plainbox/impl/providers/stubbox/po/ug.po
@@ -14,8 +14,8 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2015-10-29 05:09+0000\n"
-"X-Generator: Launchpad (build 17837)\n"
+"X-Launchpad-Export-Date: 2015-11-28 04:35+0000\n"
... 1142 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/plainbox.git



More information about the Python-modules-commits mailing list