Python API mc Module

From DevWiki

Jump to: navigation, search

Back to API Reference


Contents


MC

Module functions and types. Below you'll find the base of Boxee API. To work with anything in the python api documentation you must start here first.


ActivateWindow

void ActivateWindow(int windowID)
Activate a specific window by its id.
mc.ActivateWindow(476)


GetWindow

window GetWindow(int windowID)
Get a reference to the window by its id.
window = mc.GetWindow(14000)


CloseWindow

void CloseWindow(void)
Closes the currently active window and go to the previously open window.
mc.CloseWindow()


GetActiveWindow

window GetActiveWindow(void)
Get a reference to the currently active window object.
win = mc.GetActiveWindow()


GetApp

app GetApp(void)
Returns a reference to the object, that should be used for application specific operations.
mc.GetApp()


GetCookieJar

string GetCookieJar(void)
Returns the cookie jar used by boxee.
cookies = mc.GetCookieJar()


GetInfoString

string GetInfoString(string xmlInfoString)
Returns information about the user interface. See separate documentation regarding information that can be retrieved.
desc = mc.GetInfoString("Container(120).ListItem.property(description)")


GetLocalizedString

string GetLocalizedString(int localizedStringID)
Returns a localized string based on an id of that string. ID Can be either a system wide or application specific id.
message = "localized string for id 54974 = " + mc.GetLocalizedString(54974)


GetPlayer

player GetPlayer(void)
Returns a reference to a media player that can be used for playing media.
player = mc.GetPlayer()


GetTempDir

string GetTempDir(void)
Returns the full path of a directory where temporary files can be placed.
img = mc.GetTempDir() + "/file.jpg"


ShowDialogWait

void ShowDialogWait(void)
Displays a wait dialog. This should be displayed during long operations.
mc.ShowDialogWait()


HideDialogWait

void HideDialogWait(void)
Hides the wait dialog.
mc.HideDialogWait()


ShowDialogNotification

bool ShowDialogNotification(string message [, string thumbnail])
Displays a notification at the upper right corner of the screen for 5 seconds.
if var:
  mc.ShowDialogNotification("Invalid Username", "image.png")
else:
  mc.ShowDialogNotification("Invalid Username")


ShowDialogOk

void ShowDialogOk(string heading, string message)
Displays an "Ok" dialog for displaying information to the user.
mc.ShowDialogOk("Error", "Username provided is invalid!")


ShowDialogConfirm

bool ShowDialogConfirm(string heading, string message[, string cancelButtonLabel, string confirmButtonLabel])
Displays a confirmation dialog which returns true/false depending on user selection
response = mc.ShowDialogConfirm("My App", "Are you sure you wish to save this informaion?", "No", "Yes")
if response:
  ...


ShowDialogKeyboard

string ShowDialogKeyboard(string heading, string defaultValue, bool inputMask)
Displays a keyboard dialog for text input. Returns true if a value was entered or false if the dialog was cancelled.
response = ShowDialogKeyboard("Enter Password", "", True)


LogDebug

void LogDebug(string logMessage)
Log debug message into the Boxee log file.
mc.LogDebug("Unable to process new request -> reverting to old request")


LogError

void LogError(string logMessage)
Log error message into the Boxee log file.
mc.LogError("Unable to process new request -> reverting to old request")


LogInfo

void LogInfo(string logMessage)
Log information message into the Boxee log file.
mc.LogInfo("Unable to process new request -> reverting to old request")
Personal tools