This docs on this page refers to a PREVIOUS VERSION. For the latest stable release, go to https://docs.bokeh.org/

Archived docs for versions <= 1.0.4 have had to be modified from their original published configuration, and may be missing some features (e.g. source listing)

All users are encourage to update to version 1.1 or later, as soon as they are able.

file_output — Bokeh 0.12.14 documentation

file_output

Abstract base class for subcommands that output to a file (or stdout).

class FileOutputSubcommand(parser)[source]

Abstract subcommand to output applications as some type of file.

after_write_file(args, filename, doc)[source]
file_contents(args, doc)[source]

Subtypes must override this to return the contents of the output file for the given doc.

filename_from_route(route, ext)[source]
classmethod files_arg(output_type_name)[source]

Returns a positional arg for files to specify file inputs to the command.

Subclasses should include this to their class args.

Example

class Foo(FileOutputSubcommand):

    args = (

        FileOutputSubcommand.files_arg("FOO"),

        # more args for Foo

    ) + FileOutputSubcommand.other_args()
invoke(args)[source]
classmethod other_args()[source]

Return args for -o / --output to specify where output should be written, and for a --args to pass on any additional command line args to the subcommand.

Subclasses should append these to their class args.

Example

class Foo(FileOutputSubcommand):

    args = (

        FileOutputSubcommand.files_arg("FOO"),

        # more args for Foo

    ) + FileOutputSubcommand.other_args()
write_file(args, filename, doc)[source]