Python: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
If you're looking for the open-sourced [[Python/Code|C++ Embedding Code]].
If you're looking for the open-sourced [[Python/Code|C++ Embedding Code]].


On Windows: requires Python 2.7, 32bit.  You can [http://www.activestate.com/activepython/downloads download it here].  Be sure to get the one called "Windows (x86)"
==How to Use==
# download <googa>https://karaoke.kjams.com/downloads/Python.zip|Python.zip|/downloads/Python.zip</googa>, unzip it, and put that "Python" folder into your kJams folder. This gives you a bunch of example scripts
# On Windows: requires Python 2.7, 32bit.  You can [http://www.activestate.com/activepython/downloads download it here].  Be sure to get the one called "Windows (x86)", install that.
# Run kJams 2.  Go to the Advanced menu and see the Python submenu


On Mac: It's already installed, nothing to download.
==Tips==
* Pick "Advanced->Python->Reveal “kjams.py”", this will give you a list of enums for command, server, and others, note: most server commands are working
* A script named "startup.py" will, if present, be run on startup, so if eg: you always want to ensure some prefs are set correctly, regardless of what someone may have changed, you can use this script to set some prefs the way you like them.
* Picking anything from the Python menu will run it. Holding the alt/option key when picking it will reveal (open) the file instead
* You should open each of the files and look at them for examples


==What's working==
==What's working==
Line 27: Line 34:
* interactive string dialog, title, message, default string, OK, Cancel
* interactive string dialog, title, message, default string, OK, Cancel
* whatever else you need
* whatever else you need
==Tips==
* Pick "Advanced->Python->Reveal “kjams.py”", this will give you a list of enums for command, server, and others, note: most server commands are working
* A script named "startup.py" will be run on startup, so if eg: you always want to ensure some prefs are set correctly, regardless of what someone may have changed, you can use this script to set some prefs the way you like them.
* Picking anything from the Python menu will run it.  Holding the alt/option key when picking it will reveal (open) the file instead
* You should open each of the files and look at them for examples

Revision as of 18:47, 27 August 2013

If you're looking for the open-sourced C++ Embedding Code.

How to Use

  1. download Python.zip, unzip it, and put that "Python" folder into your kJams folder. This gives you a bunch of example scripts
  2. On Windows: requires Python 2.7, 32bit. You can download it here. Be sure to get the one called "Windows (x86)", install that.
  3. Run kJams 2. Go to the Advanced menu and see the Python submenu

Tips

  • Pick "Advanced->Python->Reveal “kjams.py”", this will give you a list of enums for command, server, and others, note: most server commands are working
  • A script named "startup.py" will, if present, be run on startup, so if eg: you always want to ensure some prefs are set correctly, regardless of what someone may have changed, you can use this script to set some prefs the way you like them.
  • Picking anything from the Python menu will run it. Holding the alt/option key when picking it will reveal (open) the file instead
  • You should open each of the files and look at them for examples

What's working

  • All the Scripting commands under the "Or Try This" section
  • Access to every menu item (not including sub-menus just yet)
  • Access to all preferences including secret prefs (prefs that otherwise have no user interface)
  • ability to show a progress bar in the activity window
  • ability to kill off a script (stop sign in activity window)
  • song meta data editing
  • Much of the Server functionality including:
  • sub-menu access
  • get/set selected playlist
  • get/set selection within playlist
  • the rest of the Scripting commands
    • fetching playlists (eg: Library, Rotation, Venue (list of singers)) etc
    • fetching info including venue name
    • singer creation and/or login
    • getting singers' lists (tonight, history, faves)
    • add songs to singer

What's Coming

  • reorder songs within a playlist (including singer)
  • message dialog, with title and message, up to 3 buttons, and 1 check box
  • interactive string dialog, title, message, default string, OK, Cancel
  • whatever else you need