Giter Site home page Giter Site logo

engineerisaac / drivers-driverpackager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from control4/drivers-driverpackager

0.0 1.0 0.0 102 KB

Python scripts to build (optionally encrypted) Control4 .c4z driver files

License: Other

Python 21.92% Lua 77.87% Dockerfile 0.04% Shell 0.01% Go 0.15%

drivers-driverpackager's Introduction

Driver Packager

Versions

  • dp: Driver Packager for Python 2
  • dp3: Driver Packager for Python 3
  • dplite: Driver Packager Lite for Python 2
  • dplite3: Driver Packager Lite for Python 3

It is recommended that new Driver Packager users use dp3.

ONLY dp3 IS GUARANTEED TO BE MAINTAINED AND UPDATED IN THE FUTURE.

The rest of this README is specific to Driver Packager 3, although much of it may also apply to other versions.

Requirements

Driver Packager requires:

Using Driver Packager to build a .c4z

usage: driverpackager.py [-h] [-v] [-u] [-ae] srcdir dstdir [manifest]

  • required arguments:

    • srcdir: Directory where c4z source files are located
    • dstdir: Directory where c4z files are placed
    • manifest: [optional] Filename of manifest xml file
  • optional arguments:

    • -h, --help: show help message and exit
    • -v, --verbose: Enable verbose
    • -u, --unzip: Unzip the c4z in the target location
    • -ae, --allowexecute: Allow Execute in Lua Command window even for encrypted driver (adds C4:AllowExecute(true) to Lua source)

Using Driver Packager in Github Actions

This repository can also be used to build your c4z projects as a GitHub Action. You'll need to use another action or script to push the file output where it needs to go next.

uses: control4/drivers-driverpackager@v1
with:
  # Directory (relative to the root of your Git repo) that contains the .c4zproj to build
  projectDir: ''
  # Filename for the c4z project to build
  c4zproj: ''
  # Directory (relative to projectDir) to output the built c4z file to
  # Defaults to the parent directory ('./../')
  outputDir: ''

Manifest File format

The manifest.xml file is an XML file, with the following format:

<Driver type="c4z" name="c4z_base_filename" squishLua="false">
  <Items>
    <Item type="file" name="driver.xml" />
    <Item type="file" name="driver.lua" />
    <Item type="file" c4zDir="www" name="www/documentation.rtf" />
    <Item type="file" name="id_ds2.gif" />
  </Items>
</Driver>

Notes:

  • c4z_base_filename within the Driver tag should be replaced with the output .c4z name.
  • Items with a 'c4zDir' attribute will get added to the .c4z in the specified directory.
  • Items 'name' attribute is relative to the directory the manifest file is in.

Driver Packager source files:

driverpackager.py:

Main Driver Packager Python script.

build_c4z.py:

Used by driverpackager to squish and zip the source files into the .c4z output.

usage: build_c4z.py [-h] [-v] [-x | -c] c4z dir

  • Arguments:

  • c4z: path to the C4Z file

  • dir: path to the C4Z contents directory

  • Optional arguments:

  • -h, --help: show help message and exit

  • -v, --verbose: Enables verbose output

  • -x, --extract: Extracts the C4Z

  • -c, --compress: Compresses the C4Z (default)

encrypt_c4z.py:

Used by driverpackager to encrypt the driver.lua source file (and any squished with it) using S-MIME encryption (DriverWorks Encryption V2).

usage: encrypt_c4z.py input_path output_path

squish:

Used by driverpackager to combine multiple Lua source files into a single Lua output file, which can then be encrypted.

Documentation for Squish can be found here: http://matthewwild.co.uk/projects/squish/readme.html

drivers-driverpackager's People

Contributors

wwalshc4 avatar fdrazicc4 avatar rericksonc4 avatar actions-user avatar

Watchers

James Cloos avatar

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.