catppuccin/samples/python2.py

35 lines
997 B
Python
Raw Normal View History

2021-12-22 04:58:53 +00:00
# Simple Python Sample
from __future__ import print_function
import os
import threading
import sublime
2022-01-05 18:54:34 +00:00
IS_ST3 = sublime.version().startswith('3')
2021-12-22 04:58:53 +00:00
def get_vcs_settings():
"""Returns list of dictionaries"""
if self.config.getboolean("verbose_stamps", fallback=False):
2022-01-07 15:48:32 +00:00
print("Sending " + command)
2021-12-22 04:58:53 +00:00
# Add a newline because the ui reads per line
command += " \n"
if self.gtk_proc:
# Send the command as bytes
self.gtk_proc.stdin.write(bytearray(command.encode("utf-8")))
self.gtk_proc.stdin.flush()
try:
constructor = getattr(module, type)
except AttributeError:
2022-01-07 15:48:32 +00:00
print(_("Error: Class {} not found").format(type))
2021-12-22 04:58:53 +00:00
continue
else
instance = constructor()
instance.verbose = verbose
instance.config = config
def do_when(conditional, callback, *args, **kwargs):
if conditional():
return callback(*args, **kwargs)
sublime.set_timeout(functools.partial(do_when, conditional, callback, *args, **kwargs), 50)