Beispiel #1
0
        public static void WriteLine(string value, EscapeFlags escapeMethod = EscapeFlags.Quotes)
        {
            string valueStr;

            valueStr  = PythonInterop.EscapeArgument(value, escapeMethod);
            valueStr += PythonInterop.EscapeArgument(NewLine, EscapeFlags.Quotes);
            PythonInterop.Eval(string.Format("sys.stdout.write({0})", valueStr));
        }
Beispiel #2
0
        /// <summary>
        /// Writes the text representation of the specified object to kodi.log with "sys.stdout.write"
        /// </summary>
        /// <param name="value"></param>
        public static void Write(object value, EscapeFlags escapeMethod = EscapeFlags.Quotes)
        {
            string valueStr = value.ToString();

            valueStr = PythonInterop.EscapeArgument(valueStr, escapeMethod);

            PythonInterop.Eval(string.Format("sys.stdout.write({0})", valueStr));
        }
Beispiel #3
0
        /// <summary>
        /// Writes the text representation of the specified object to kodi.log with "print"
        /// </summary>
        /// <param name="value"></param>
        public static void Print(object value)
        {
            string valueStr = PythonInterop.EscapeArgument(value.ToString());

            if (KodiBridge.RunningAddon.DebugEnabled)
            {
                Console.Error.WriteLine($"[PyConsole] {valueStr}");
            }
            PythonInterop.Eval(string.Format("print {0}", valueStr));
        }
Beispiel #4
0
        /// <summary>
        /// Writes the text representation of the specified object to kodi.log with "sys.stdout.write"
        /// </summary>
        /// <param name="value"></param>
        public static void Write(object value, EscapeFlags escapeMethod = EscapeFlags.Quotes)
        {
            string valueStr = value.ToString();

            if (KodiBridge.RunningAddon.DebugEnabled)
            {
                Console.Error.WriteLine($"[PyConsole] {valueStr}");
            }
            valueStr = PythonInterop.EscapeArgument(valueStr, escapeMethod);

            PythonInterop.Eval(string.Format("sys.stdout.write({0})", valueStr));
        }
Beispiel #5
0
        /// <summary>
        /// Writes the text representation of the specified object to kodi.log with "print"
        /// </summary>
        /// <param name="value"></param>
        public static void Print(object value)
        {
            string valueStr = PythonInterop.EscapeArgument(value.ToString());

            PythonInterop.Eval(string.Format("print {0}", valueStr));
        }