repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
celery/django-celery
djcelery/loaders.py
DjangoLoader.read_configuration
def read_configuration(self): """Load configuration from Django settings.""" self.configured = True # Default backend needs to be the database backend for backward # compatibility. backend = (getattr(settings, 'CELERY_RESULT_BACKEND', None) or getattr(settings,...
python
def read_configuration(self): """Load configuration from Django settings.""" self.configured = True # Default backend needs to be the database backend for backward # compatibility. backend = (getattr(settings, 'CELERY_RESULT_BACKEND', None) or getattr(settings,...
[ "def", "read_configuration", "(", "self", ")", ":", "self", ".", "configured", "=", "True", "# Default backend needs to be the database backend for backward", "# compatibility.", "backend", "=", "(", "getattr", "(", "settings", ",", "'CELERY_RESULT_BACKEND'", ",", "None",...
Load configuration from Django settings.
[ "Load", "configuration", "from", "Django", "settings", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L57-L66
train
celery/django-celery
djcelery/loaders.py
DjangoLoader.on_task_init
def on_task_init(self, task_id, task): """Called before every task.""" try: is_eager = task.request.is_eager except AttributeError: is_eager = False if not is_eager: self.close_database()
python
def on_task_init(self, task_id, task): """Called before every task.""" try: is_eager = task.request.is_eager except AttributeError: is_eager = False if not is_eager: self.close_database()
[ "def", "on_task_init", "(", "self", ",", "task_id", ",", "task", ")", ":", "try", ":", "is_eager", "=", "task", ".", "request", ".", "is_eager", "except", "AttributeError", ":", "is_eager", "=", "False", "if", "not", "is_eager", ":", "self", ".", "close_...
Called before every task.
[ "Called", "before", "every", "task", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L110-L117
train
celery/django-celery
djcelery/humanize.py
naturaldate
def naturaldate(date, include_seconds=False): """Convert datetime into a human natural date string.""" if not date: return '' right_now = now() today = datetime(right_now.year, right_now.month, right_now.day, tzinfo=right_now.tzinfo) delta = right_now - date delta_...
python
def naturaldate(date, include_seconds=False): """Convert datetime into a human natural date string.""" if not date: return '' right_now = now() today = datetime(right_now.year, right_now.month, right_now.day, tzinfo=right_now.tzinfo) delta = right_now - date delta_...
[ "def", "naturaldate", "(", "date", ",", "include_seconds", "=", "False", ")", ":", "if", "not", "date", ":", "return", "''", "right_now", "=", "now", "(", ")", "today", "=", "datetime", "(", "right_now", ".", "year", ",", "right_now", ".", "month", ","...
Convert datetime into a human natural date string.
[ "Convert", "datetime", "into", "a", "human", "natural", "date", "string", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/humanize.py#L38-L85
train
celery/django-celery
djcelery/views.py
apply
def apply(request, task_name): """View applying a task. **Note:** Please use this with caution. Preferably you shouldn't make this publicly accessible without ensuring your code is safe! """ try: task = tasks[task_name] except KeyError: raise Http404('apply: no such task') ...
python
def apply(request, task_name): """View applying a task. **Note:** Please use this with caution. Preferably you shouldn't make this publicly accessible without ensuring your code is safe! """ try: task = tasks[task_name] except KeyError: raise Http404('apply: no such task') ...
[ "def", "apply", "(", "request", ",", "task_name", ")", ":", "try", ":", "task", "=", "tasks", "[", "task_name", "]", "except", "KeyError", ":", "raise", "Http404", "(", "'apply: no such task'", ")", "return", "task_view", "(", "task", ")", "(", "request", ...
View applying a task. **Note:** Please use this with caution. Preferably you shouldn't make this publicly accessible without ensuring your code is safe!
[ "View", "applying", "a", "task", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L46-L57
train
celery/django-celery
djcelery/views.py
task_status
def task_status(request, task_id): """Returns task status and result in JSON format.""" result = AsyncResult(task_id) state, retval = result.state, result.result response_data = {'id': task_id, 'status': state, 'result': retval} if state in states.EXCEPTION_STATES: traceback = result.traceba...
python
def task_status(request, task_id): """Returns task status and result in JSON format.""" result = AsyncResult(task_id) state, retval = result.state, result.result response_data = {'id': task_id, 'status': state, 'result': retval} if state in states.EXCEPTION_STATES: traceback = result.traceba...
[ "def", "task_status", "(", "request", ",", "task_id", ")", ":", "result", "=", "AsyncResult", "(", "task_id", ")", "state", ",", "retval", "=", "result", ".", "state", ",", "result", ".", "result", "response_data", "=", "{", "'id'", ":", "task_id", ",", ...
Returns task status and result in JSON format.
[ "Returns", "task", "status", "and", "result", "in", "JSON", "format", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L68-L78
train
celery/django-celery
djcelery/views.py
task_webhook
def task_webhook(fun): """Decorator turning a function into a task webhook. If an exception is raised within the function, the decorated function catches this and returns an error JSON response, otherwise it returns the result as a JSON response. Example: .. code-block:: python @tas...
python
def task_webhook(fun): """Decorator turning a function into a task webhook. If an exception is raised within the function, the decorated function catches this and returns an error JSON response, otherwise it returns the result as a JSON response. Example: .. code-block:: python @tas...
[ "def", "task_webhook", "(", "fun", ")", ":", "@", "wraps", "(", "fun", ")", "def", "_inner", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "retval", "=", "fun", "(", "*", "args", ",", "*", "*", "kwargs", ")", "except", "Excep...
Decorator turning a function into a task webhook. If an exception is raised within the function, the decorated function catches this and returns an error JSON response, otherwise it returns the result as a JSON response. Example: .. code-block:: python @task_webhook def add(requ...
[ "Decorator", "turning", "a", "function", "into", "a", "task", "webhook", "." ]
5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef
https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L86-L125
train
Guake/guake
guake/menus.py
mk_tab_context_menu
def mk_tab_context_menu(callback_object): """Create the context menu for a notebook tab """ # Store the menu in a temp variable in terminal so that popup() is happy. See: # https://stackoverflow.com/questions/28465956/ callback_object.context_menu = Gtk.Menu() menu = callback_object.context_me...
python
def mk_tab_context_menu(callback_object): """Create the context menu for a notebook tab """ # Store the menu in a temp variable in terminal so that popup() is happy. See: # https://stackoverflow.com/questions/28465956/ callback_object.context_menu = Gtk.Menu() menu = callback_object.context_me...
[ "def", "mk_tab_context_menu", "(", "callback_object", ")", ":", "# Store the menu in a temp variable in terminal so that popup() is happy. See:", "# https://stackoverflow.com/questions/28465956/", "callback_object", ".", "context_menu", "=", "Gtk", ".", "Menu", "(", ")", "menu", ...
Create the context menu for a notebook tab
[ "Create", "the", "context", "menu", "for", "a", "notebook", "tab" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/menus.py#L13-L30
train
Guake/guake
guake/menus.py
mk_notebook_context_menu
def mk_notebook_context_menu(callback_object): """Create the context menu for the notebook """ callback_object.context_menu = Gtk.Menu() menu = callback_object.context_menu mi = Gtk.MenuItem(_("New Tab")) mi.connect("activate", callback_object.on_new_tab) menu.add(mi) menu.add(Gtk.Separa...
python
def mk_notebook_context_menu(callback_object): """Create the context menu for the notebook """ callback_object.context_menu = Gtk.Menu() menu = callback_object.context_menu mi = Gtk.MenuItem(_("New Tab")) mi.connect("activate", callback_object.on_new_tab) menu.add(mi) menu.add(Gtk.Separa...
[ "def", "mk_notebook_context_menu", "(", "callback_object", ")", ":", "callback_object", ".", "context_menu", "=", "Gtk", ".", "Menu", "(", ")", "menu", "=", "callback_object", ".", "context_menu", "mi", "=", "Gtk", ".", "MenuItem", "(", "_", "(", "\"New Tab\""...
Create the context menu for the notebook
[ "Create", "the", "context", "menu", "for", "the", "notebook" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/menus.py#L33-L62
train
Guake/guake
guake/gsettings.py
GSettingHandler.ontop_toggled
def ontop_toggled(self, settings, key, user_data): """If the gconf var window_ontop be changed, this method will be called and will set the keep_above attribute in guake's main window. """ self.guake.window.set_keep_above(settings.get_boolean(key))
python
def ontop_toggled(self, settings, key, user_data): """If the gconf var window_ontop be changed, this method will be called and will set the keep_above attribute in guake's main window. """ self.guake.window.set_keep_above(settings.get_boolean(key))
[ "def", "ontop_toggled", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "self", ".", "guake", ".", "window", ".", "set_keep_above", "(", "settings", ".", "get_boolean", "(", "key", ")", ")" ]
If the gconf var window_ontop be changed, this method will be called and will set the keep_above attribute in guake's main window.
[ "If", "the", "gconf", "var", "window_ontop", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "set", "the", "keep_above", "attribute", "in", "guake", "s", "main", "window", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L103-L108
train
Guake/guake
guake/gsettings.py
GSettingHandler.alignment_changed
def alignment_changed(self, settings, key, user_data): """If the gconf var window_halignment be changed, this method will be called and will call the move function in guake. """ RectCalculator.set_final_window_rect(self.settings, self.guake.window) self.guake.set_tab_position() ...
python
def alignment_changed(self, settings, key, user_data): """If the gconf var window_halignment be changed, this method will be called and will call the move function in guake. """ RectCalculator.set_final_window_rect(self.settings, self.guake.window) self.guake.set_tab_position() ...
[ "def", "alignment_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "RectCalculator", ".", "set_final_window_rect", "(", "self", ".", "settings", ",", "self", ".", "guake", ".", "window", ")", "self", ".", "guake", ".", "set_t...
If the gconf var window_halignment be changed, this method will be called and will call the move function in guake.
[ "If", "the", "gconf", "var", "window_halignment", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "call", "the", "move", "function", "in", "guake", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L126-L132
train
Guake/guake
guake/gsettings.py
GSettingHandler.size_changed
def size_changed(self, settings, key, user_data): """If the gconf var window_height or window_width are changed, this method will be called and will call the resize function in guake. """ RectCalculator.set_final_window_rect(self.settings, self.guake.window)
python
def size_changed(self, settings, key, user_data): """If the gconf var window_height or window_width are changed, this method will be called and will call the resize function in guake. """ RectCalculator.set_final_window_rect(self.settings, self.guake.window)
[ "def", "size_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "RectCalculator", ".", "set_final_window_rect", "(", "self", ".", "settings", ",", "self", ".", "guake", ".", "window", ")" ]
If the gconf var window_height or window_width are changed, this method will be called and will call the resize function in guake.
[ "If", "the", "gconf", "var", "window_height", "or", "window_width", "are", "changed", "this", "method", "will", "be", "called", "and", "will", "call", "the", "resize", "function", "in", "guake", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L134-L139
train
Guake/guake
guake/gsettings.py
GSettingHandler.cursor_blink_mode_changed
def cursor_blink_mode_changed(self, settings, key, user_data): """Called when cursor blink mode settings has been changed """ for term in self.guake.notebook_manager.iter_terminals(): term.set_property("cursor-blink-mode", settings.get_int(key))
python
def cursor_blink_mode_changed(self, settings, key, user_data): """Called when cursor blink mode settings has been changed """ for term in self.guake.notebook_manager.iter_terminals(): term.set_property("cursor-blink-mode", settings.get_int(key))
[ "def", "cursor_blink_mode_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "term", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "term", ".", "set_property", "(", "\"cursor-bl...
Called when cursor blink mode settings has been changed
[ "Called", "when", "cursor", "blink", "mode", "settings", "has", "been", "changed" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L141-L145
train
Guake/guake
guake/gsettings.py
GSettingHandler.history_size_changed
def history_size_changed(self, settings, key, user_data): """If the gconf var history_size be changed, this method will be called and will set the scrollback_lines property of all terminals open. """ lines = settings.get_int(key) for i in self.guake.notebook_manager.iter_...
python
def history_size_changed(self, settings, key, user_data): """If the gconf var history_size be changed, this method will be called and will set the scrollback_lines property of all terminals open. """ lines = settings.get_int(key) for i in self.guake.notebook_manager.iter_...
[ "def", "history_size_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "lines", "=", "settings", ".", "get_int", "(", "key", ")", "for", "i", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", "...
If the gconf var history_size be changed, this method will be called and will set the scrollback_lines property of all terminals open.
[ "If", "the", "gconf", "var", "history_size", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "set", "the", "scrollback_lines", "property", "of", "all", "terminals", "open", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L171-L178
train
Guake/guake
guake/gsettings.py
GSettingHandler.keystroke_output
def keystroke_output(self, settings, key, user_data): """If the gconf var scroll_output be changed, this method will be called and will set the scroll_on_output in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_scroll_on_output(se...
python
def keystroke_output(self, settings, key, user_data): """If the gconf var scroll_output be changed, this method will be called and will set the scroll_on_output in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_scroll_on_output(se...
[ "def", "keystroke_output", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "i", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "i", ".", "set_scroll_on_output", "(", "settings", ".", ...
If the gconf var scroll_output be changed, this method will be called and will set the scroll_on_output in all terminals open.
[ "If", "the", "gconf", "var", "scroll_output", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "set", "the", "scroll_on_output", "in", "all", "terminals", "open", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L188-L194
train
Guake/guake
guake/gsettings.py
GSettingHandler.keystroke_toggled
def keystroke_toggled(self, settings, key, user_data): """If the gconf var scroll_keystroke be changed, this method will be called and will set the scroll_on_keystroke in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_scroll_on_ke...
python
def keystroke_toggled(self, settings, key, user_data): """If the gconf var scroll_keystroke be changed, this method will be called and will set the scroll_on_keystroke in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_scroll_on_ke...
[ "def", "keystroke_toggled", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "i", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "i", ".", "set_scroll_on_keystroke", "(", "settings", "...
If the gconf var scroll_keystroke be changed, this method will be called and will set the scroll_on_keystroke in all terminals open.
[ "If", "the", "gconf", "var", "scroll_keystroke", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "set", "the", "scroll_on_keystroke", "in", "all", "terminals", "open", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L196-L202
train
Guake/guake
guake/gsettings.py
GSettingHandler.allow_bold_toggled
def allow_bold_toggled(self, settings, key, user_data): """If the gconf var allow_bold is changed, this method will be called and will change the VTE terminal o. displaying characters in bold font. """ for term in self.guake.notebook_manager.iter_terminals(): term.set...
python
def allow_bold_toggled(self, settings, key, user_data): """If the gconf var allow_bold is changed, this method will be called and will change the VTE terminal o. displaying characters in bold font. """ for term in self.guake.notebook_manager.iter_terminals(): term.set...
[ "def", "allow_bold_toggled", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "term", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "term", ".", "set_allow_bold", "(", "settings", "."...
If the gconf var allow_bold is changed, this method will be called and will change the VTE terminal o. displaying characters in bold font.
[ "If", "the", "gconf", "var", "allow_bold", "is", "changed", "this", "method", "will", "be", "called", "and", "will", "change", "the", "VTE", "terminal", "o", ".", "displaying", "characters", "in", "bold", "font", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L226-L232
train
Guake/guake
guake/gsettings.py
GSettingHandler.bold_is_bright_toggled
def bold_is_bright_toggled(self, settings, key, user_data): """If the dconf var bold_is_bright is changed, this method will be called and will change the VTE terminal to toggle auto-brightened bold text. """ try: for term in self.guake.notebook_manager.iter_terminals(): ...
python
def bold_is_bright_toggled(self, settings, key, user_data): """If the dconf var bold_is_bright is changed, this method will be called and will change the VTE terminal to toggle auto-brightened bold text. """ try: for term in self.guake.notebook_manager.iter_terminals(): ...
[ "def", "bold_is_bright_toggled", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "try", ":", "for", "term", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "term", ".", "set_bold_is_bright", ...
If the dconf var bold_is_bright is changed, this method will be called and will change the VTE terminal to toggle auto-brightened bold text.
[ "If", "the", "dconf", "var", "bold_is_bright", "is", "changed", "this", "method", "will", "be", "called", "and", "will", "change", "the", "VTE", "terminal", "to", "toggle", "auto", "-", "brightened", "bold", "text", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L234-L242
train
Guake/guake
guake/gsettings.py
GSettingHandler.palette_font_and_background_color_toggled
def palette_font_and_background_color_toggled(self, settings, key, user_data): """If the gconf var use_palette_font_and_background_color be changed, this method will be called and will change the font color and the background color to the color defined in the palette. """ self.se...
python
def palette_font_and_background_color_toggled(self, settings, key, user_data): """If the gconf var use_palette_font_and_background_color be changed, this method will be called and will change the font color and the background color to the color defined in the palette. """ self.se...
[ "def", "palette_font_and_background_color_toggled", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "self", ".", "settings", ".", "styleFont", ".", "triggerOnChangedValue", "(", "self", ".", "settings", ".", "styleFont", ",", "'palette'", "...
If the gconf var use_palette_font_and_background_color be changed, this method will be called and will change the font color and the background color to the color defined in the palette.
[ "If", "the", "gconf", "var", "use_palette_font_and_background_color", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "change", "the", "font", "color", "and", "the", "background", "color", "to", "the", "color", "defined", "in", "the", ...
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L244-L249
train
Guake/guake
guake/gsettings.py
GSettingHandler.backspace_changed
def backspace_changed(self, settings, key, user_data): """If the gconf var compat_backspace be changed, this method will be called and will change the binding configuration in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_backspa...
python
def backspace_changed(self, settings, key, user_data): """If the gconf var compat_backspace be changed, this method will be called and will change the binding configuration in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_backspa...
[ "def", "backspace_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "i", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "i", ".", "set_backspace_binding", "(", "self", ".", ...
If the gconf var compat_backspace be changed, this method will be called and will change the binding configuration in all terminals open.
[ "If", "the", "gconf", "var", "compat_backspace", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "change", "the", "binding", "configuration", "in", "all", "terminals", "open", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L286-L292
train
Guake/guake
guake/gsettings.py
GSettingHandler.delete_changed
def delete_changed(self, settings, key, user_data): """If the gconf var compat_delete be changed, this method will be called and will change the binding configuration in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_delete_bindin...
python
def delete_changed(self, settings, key, user_data): """If the gconf var compat_delete be changed, this method will be called and will change the binding configuration in all terminals open. """ for i in self.guake.notebook_manager.iter_terminals(): i.set_delete_bindin...
[ "def", "delete_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "for", "i", "in", "self", ".", "guake", ".", "notebook_manager", ".", "iter_terminals", "(", ")", ":", "i", ".", "set_delete_binding", "(", "self", ".", "getEr...
If the gconf var compat_delete be changed, this method will be called and will change the binding configuration in all terminals open.
[ "If", "the", "gconf", "var", "compat_delete", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "change", "the", "binding", "configuration", "in", "all", "terminals", "open", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L294-L300
train
Guake/guake
guake/gsettings.py
GSettingHandler.max_tab_name_length_changed
def max_tab_name_length_changed(self, settings, key, user_data): """If the gconf var max_tab_name_length be changed, this method will be called and will set the tab name length limit. """ # avoid get window title before terminal is ready if self.guake.notebook_manager.get_curren...
python
def max_tab_name_length_changed(self, settings, key, user_data): """If the gconf var max_tab_name_length be changed, this method will be called and will set the tab name length limit. """ # avoid get window title before terminal is ready if self.guake.notebook_manager.get_curren...
[ "def", "max_tab_name_length_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "# avoid get window title before terminal is ready", "if", "self", ".", "guake", ".", "notebook_manager", ".", "get_current_notebook", "(", ")", ".", "get_curre...
If the gconf var max_tab_name_length be changed, this method will be called and will set the tab name length limit.
[ "If", "the", "gconf", "var", "max_tab_name_length", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "set", "the", "tab", "name", "length", "limit", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L302-L315
train
Guake/guake
guake/gsettings.py
GSettingHandler.abbreviate_tab_names_changed
def abbreviate_tab_names_changed(self, settings, key, user_data): """If the gconf var abbreviate_tab_names be changed, this method will be called and will update tab names. """ abbreviate_tab_names = settings.get_boolean('abbreviate-tab-names') self.guake.abbreviate = abbreviate_...
python
def abbreviate_tab_names_changed(self, settings, key, user_data): """If the gconf var abbreviate_tab_names be changed, this method will be called and will update tab names. """ abbreviate_tab_names = settings.get_boolean('abbreviate-tab-names') self.guake.abbreviate = abbreviate_...
[ "def", "abbreviate_tab_names_changed", "(", "self", ",", "settings", ",", "key", ",", "user_data", ")", ":", "abbreviate_tab_names", "=", "settings", ".", "get_boolean", "(", "'abbreviate-tab-names'", ")", "self", ".", "guake", ".", "abbreviate", "=", "abbreviate_...
If the gconf var abbreviate_tab_names be changed, this method will be called and will update tab names.
[ "If", "the", "gconf", "var", "abbreviate_tab_names", "be", "changed", "this", "method", "will", "be", "called", "and", "will", "update", "tab", "names", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L317-L323
train
Guake/guake
guake/keybindings.py
Keybindings.reload_accelerators
def reload_accelerators(self, *args): """Reassign an accel_group to guake main window and guake context menu and calls the load_accelerators method. """ if self.accel_group: self.guake.window.remove_accel_group(self.accel_group) self.accel_group = Gtk.AccelGroup() ...
python
def reload_accelerators(self, *args): """Reassign an accel_group to guake main window and guake context menu and calls the load_accelerators method. """ if self.accel_group: self.guake.window.remove_accel_group(self.accel_group) self.accel_group = Gtk.AccelGroup() ...
[ "def", "reload_accelerators", "(", "self", ",", "*", "args", ")", ":", "if", "self", ".", "accel_group", ":", "self", ".", "guake", ".", "window", ".", "remove_accel_group", "(", "self", ".", "accel_group", ")", "self", ".", "accel_group", "=", "Gtk", "....
Reassign an accel_group to guake main window and guake context menu and calls the load_accelerators method.
[ "Reassign", "an", "accel_group", "to", "guake", "main", "window", "and", "guake", "context", "menu", "and", "calls", "the", "load_accelerators", "method", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/keybindings.py#L104-L112
train
Guake/guake
guake/globals.py
bindtextdomain
def bindtextdomain(app_name, locale_dir=None): """ Bind the domain represented by app_name to the locale directory locale_dir. It has the effect of loading translations, enabling applications for different languages. app_name: a domain to look for translations, typically the name of an appl...
python
def bindtextdomain(app_name, locale_dir=None): """ Bind the domain represented by app_name to the locale directory locale_dir. It has the effect of loading translations, enabling applications for different languages. app_name: a domain to look for translations, typically the name of an appl...
[ "def", "bindtextdomain", "(", "app_name", ",", "locale_dir", "=", "None", ")", ":", "import", "locale", "from", "locale", "import", "gettext", "as", "_", "log", ".", "info", "(", "\"Local binding for app '%s', local dir: %s\"", ",", "app_name", ",", "locale_dir", ...
Bind the domain represented by app_name to the locale directory locale_dir. It has the effect of loading translations, enabling applications for different languages. app_name: a domain to look for translations, typically the name of an application. locale_dir: a directory with locales ...
[ "Bind", "the", "domain", "represented", "by", "app_name", "to", "the", "locale", "directory", "locale_dir", ".", "It", "has", "the", "effect", "of", "loading", "translations", "enabling", "applications", "for", "different", "languages", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/globals.py#L38-L58
train
Guake/guake
guake/prefs.py
setup_standalone_signals
def setup_standalone_signals(instance): """Called when prefs dialog is running in standalone mode. It makes the delete event of dialog and click on close button finish the application. """ window = instance.get_widget('config-window') window.connect('delete-event', Gtk.main_quit) # We need ...
python
def setup_standalone_signals(instance): """Called when prefs dialog is running in standalone mode. It makes the delete event of dialog and click on close button finish the application. """ window = instance.get_widget('config-window') window.connect('delete-event', Gtk.main_quit) # We need ...
[ "def", "setup_standalone_signals", "(", "instance", ")", ":", "window", "=", "instance", ".", "get_widget", "(", "'config-window'", ")", "window", ".", "connect", "(", "'delete-event'", ",", "Gtk", ".", "main_quit", ")", "# We need to block the execution of the alread...
Called when prefs dialog is running in standalone mode. It makes the delete event of dialog and click on close button finish the application.
[ "Called", "when", "prefs", "dialog", "is", "running", "in", "standalone", "mode", ".", "It", "makes", "the", "delete", "event", "of", "dialog", "and", "click", "on", "close", "button", "finish", "the", "application", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1490-L1504
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_default_shell_changed
def on_default_shell_changed(self, combo): """Changes the activity of default_shell in dconf """ citer = combo.get_active_iter() if not citer: return shell = combo.get_model().get_value(citer, 0) # we unset the value (restore to default) when user chooses to u...
python
def on_default_shell_changed(self, combo): """Changes the activity of default_shell in dconf """ citer = combo.get_active_iter() if not citer: return shell = combo.get_model().get_value(citer, 0) # we unset the value (restore to default) when user chooses to u...
[ "def", "on_default_shell_changed", "(", "self", ",", "combo", ")", ":", "citer", "=", "combo", ".", "get_active_iter", "(", ")", "if", "not", "citer", ":", "return", "shell", "=", "combo", ".", "get_model", "(", ")", ".", "get_value", "(", "citer", ",", ...
Changes the activity of default_shell in dconf
[ "Changes", "the", "activity", "of", "default_shell", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L368-L380
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_gtk_theme_name_changed
def on_gtk_theme_name_changed(self, combo): """Set the `gtk_theme_name' property in dconf """ citer = combo.get_active_iter() if not citer: return theme_name = combo.get_model().get_value(citer, 0) self.settings.general.set_string('gtk-theme-name', theme_name)...
python
def on_gtk_theme_name_changed(self, combo): """Set the `gtk_theme_name' property in dconf """ citer = combo.get_active_iter() if not citer: return theme_name = combo.get_model().get_value(citer, 0) self.settings.general.set_string('gtk-theme-name', theme_name)...
[ "def", "on_gtk_theme_name_changed", "(", "self", ",", "combo", ")", ":", "citer", "=", "combo", ".", "get_active_iter", "(", ")", "if", "not", "citer", ":", "return", "theme_name", "=", "combo", ".", "get_model", "(", ")", ".", "get_value", "(", "citer", ...
Set the `gtk_theme_name' property in dconf
[ "Set", "the", "gtk_theme_name", "property", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L417-L425
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_gtk_prefer_dark_theme_toggled
def on_gtk_prefer_dark_theme_toggled(self, chk): """Set the `gtk_prefer_dark_theme' property in dconf """ self.settings.general.set_boolean('gtk-prefer-dark-theme', chk.get_active()) select_gtk_theme(self.settings)
python
def on_gtk_prefer_dark_theme_toggled(self, chk): """Set the `gtk_prefer_dark_theme' property in dconf """ self.settings.general.set_boolean('gtk-prefer-dark-theme', chk.get_active()) select_gtk_theme(self.settings)
[ "def", "on_gtk_prefer_dark_theme_toggled", "(", "self", ",", "chk", ")", ":", "self", ".", "settings", ".", "general", ".", "set_boolean", "(", "'gtk-prefer-dark-theme'", ",", "chk", ".", "get_active", "(", ")", ")", "select_gtk_theme", "(", "self", ".", "sett...
Set the `gtk_prefer_dark_theme' property in dconf
[ "Set", "the", "gtk_prefer_dark_theme", "property", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L427-L431
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_start_at_login_toggled
def on_start_at_login_toggled(self, chk): """Changes the activity of start_at_login in dconf """ self.settings.general.set_boolean('start-at-login', chk.get_active()) refresh_user_start(self.settings)
python
def on_start_at_login_toggled(self, chk): """Changes the activity of start_at_login in dconf """ self.settings.general.set_boolean('start-at-login', chk.get_active()) refresh_user_start(self.settings)
[ "def", "on_start_at_login_toggled", "(", "self", ",", "chk", ")", ":", "self", ".", "settings", ".", "general", ".", "set_boolean", "(", "'start-at-login'", ",", "chk", ".", "get_active", "(", ")", ")", "refresh_user_start", "(", "self", ".", "settings", ")"...
Changes the activity of start_at_login in dconf
[ "Changes", "the", "activity", "of", "start_at_login", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L480-L484
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_max_tab_name_length_changed
def on_max_tab_name_length_changed(self, spin): """Changes the value of max_tab_name_length in dconf """ val = int(spin.get_value()) self.settings.general.set_int('max-tab-name-length', val) self.prefDlg.update_vte_subwidgets_states()
python
def on_max_tab_name_length_changed(self, spin): """Changes the value of max_tab_name_length in dconf """ val = int(spin.get_value()) self.settings.general.set_int('max-tab-name-length', val) self.prefDlg.update_vte_subwidgets_states()
[ "def", "on_max_tab_name_length_changed", "(", "self", ",", "spin", ")", ":", "val", "=", "int", "(", "spin", ".", "get_value", "(", ")", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'max-tab-name-length'", ",", "val", ")", "self", ...
Changes the value of max_tab_name_length in dconf
[ "Changes", "the", "value", "of", "max_tab_name_length", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L501-L506
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_right_align_toggled
def on_right_align_toggled(self, chk): """set the horizontal alignment setting. """ v = chk.get_active() self.settings.general.set_int('window-halignment', 1 if v else 0)
python
def on_right_align_toggled(self, chk): """set the horizontal alignment setting. """ v = chk.get_active() self.settings.general.set_int('window-halignment', 1 if v else 0)
[ "def", "on_right_align_toggled", "(", "self", ",", "chk", ")", ":", "v", "=", "chk", ".", "get_active", "(", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-halignment'", ",", "1", "if", "v", "else", "0", ")" ]
set the horizontal alignment setting.
[ "set", "the", "horizontal", "alignment", "setting", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L514-L518
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_bottom_align_toggled
def on_bottom_align_toggled(self, chk): """set the vertical alignment setting. """ v = chk.get_active() self.settings.general.set_int('window-valignment', ALIGN_BOTTOM if v else ALIGN_TOP)
python
def on_bottom_align_toggled(self, chk): """set the vertical alignment setting. """ v = chk.get_active() self.settings.general.set_int('window-valignment', ALIGN_BOTTOM if v else ALIGN_TOP)
[ "def", "on_bottom_align_toggled", "(", "self", ",", "chk", ")", ":", "v", "=", "chk", ".", "get_active", "(", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-valignment'", ",", "ALIGN_BOTTOM", "if", "v", "else", "ALIGN_TOP", ")"...
set the vertical alignment setting.
[ "set", "the", "vertical", "alignment", "setting", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L520-L524
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_display_n_changed
def on_display_n_changed(self, combo): """Set the destination display in dconf. """ i = combo.get_active_iter() if not i: return model = combo.get_model() first_item_path = model.get_path(model.get_iter_first()) if model.get_path(i) == first_item_pa...
python
def on_display_n_changed(self, combo): """Set the destination display in dconf. """ i = combo.get_active_iter() if not i: return model = combo.get_model() first_item_path = model.get_path(model.get_iter_first()) if model.get_path(i) == first_item_pa...
[ "def", "on_display_n_changed", "(", "self", ",", "combo", ")", ":", "i", "=", "combo", ".", "get_active_iter", "(", ")", "if", "not", "i", ":", "return", "model", "=", "combo", ".", "get_model", "(", ")", "first_item_path", "=", "model", ".", "get_path",...
Set the destination display in dconf.
[ "Set", "the", "destination", "display", "in", "dconf", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L526-L542
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_window_height_value_changed
def on_window_height_value_changed(self, hscale): """Changes the value of window_height in dconf """ val = hscale.get_value() self.settings.general.set_int('window-height', int(val))
python
def on_window_height_value_changed(self, hscale): """Changes the value of window_height in dconf """ val = hscale.get_value() self.settings.general.set_int('window-height', int(val))
[ "def", "on_window_height_value_changed", "(", "self", ",", "hscale", ")", ":", "val", "=", "hscale", ".", "get_value", "(", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-height'", ",", "int", "(", "val", ")", ")" ]
Changes the value of window_height in dconf
[ "Changes", "the", "value", "of", "window_height", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L544-L548
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_window_width_value_changed
def on_window_width_value_changed(self, wscale): """Changes the value of window_width in dconf """ val = wscale.get_value() self.settings.general.set_int('window-width', int(val))
python
def on_window_width_value_changed(self, wscale): """Changes the value of window_width in dconf """ val = wscale.get_value() self.settings.general.set_int('window-width', int(val))
[ "def", "on_window_width_value_changed", "(", "self", ",", "wscale", ")", ":", "val", "=", "wscale", ".", "get_value", "(", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-width'", ",", "int", "(", "val", ")", ")" ]
Changes the value of window_width in dconf
[ "Changes", "the", "value", "of", "window_width", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L550-L554
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_window_halign_value_changed
def on_window_halign_value_changed(self, halign_button): """Changes the value of window_halignment in dconf """ which_align = { 'radiobutton_align_left': ALIGN_LEFT, 'radiobutton_align_right': ALIGN_RIGHT, 'radiobutton_align_center': ALIGN_CENTER } ...
python
def on_window_halign_value_changed(self, halign_button): """Changes the value of window_halignment in dconf """ which_align = { 'radiobutton_align_left': ALIGN_LEFT, 'radiobutton_align_right': ALIGN_RIGHT, 'radiobutton_align_center': ALIGN_CENTER } ...
[ "def", "on_window_halign_value_changed", "(", "self", ",", "halign_button", ")", ":", "which_align", "=", "{", "'radiobutton_align_left'", ":", "ALIGN_LEFT", ",", "'radiobutton_align_right'", ":", "ALIGN_RIGHT", ",", "'radiobutton_align_center'", ":", "ALIGN_CENTER", "}",...
Changes the value of window_halignment in dconf
[ "Changes", "the", "value", "of", "window_halignment", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L556-L570
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_history_size_value_changed
def on_history_size_value_changed(self, spin): """Changes the value of history_size in dconf """ val = int(spin.get_value()) self.settings.general.set_int('history-size', val) self._update_history_widgets()
python
def on_history_size_value_changed(self, spin): """Changes the value of history_size in dconf """ val = int(spin.get_value()) self.settings.general.set_int('history-size', val) self._update_history_widgets()
[ "def", "on_history_size_value_changed", "(", "self", ",", "spin", ")", ":", "val", "=", "int", "(", "spin", ".", "get_value", "(", ")", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'history-size'", ",", "val", ")", "self", ".", "...
Changes the value of history_size in dconf
[ "Changes", "the", "value", "of", "history_size", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L584-L589
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_transparency_value_changed
def on_transparency_value_changed(self, hscale): """Changes the value of background_transparency in dconf """ value = hscale.get_value() self.prefDlg.set_colors_from_settings() self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value))
python
def on_transparency_value_changed(self, hscale): """Changes the value of background_transparency in dconf """ value = hscale.get_value() self.prefDlg.set_colors_from_settings() self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value))
[ "def", "on_transparency_value_changed", "(", "self", ",", "hscale", ")", ":", "value", "=", "hscale", ".", "get_value", "(", ")", "self", ".", "prefDlg", ".", "set_colors_from_settings", "(", ")", "self", ".", "settings", ".", "styleBackground", ".", "set_int"...
Changes the value of background_transparency in dconf
[ "Changes", "the", "value", "of", "background_transparency", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L631-L636
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_backspace_binding_changed
def on_backspace_binding_changed(self, combo): """Changes the value of compat_backspace in dconf """ val = combo.get_active_text() self.settings.general.set_string('compat-backspace', ERASE_BINDINGS[val])
python
def on_backspace_binding_changed(self, combo): """Changes the value of compat_backspace in dconf """ val = combo.get_active_text() self.settings.general.set_string('compat-backspace', ERASE_BINDINGS[val])
[ "def", "on_backspace_binding_changed", "(", "self", ",", "combo", ")", ":", "val", "=", "combo", ".", "get_active_text", "(", ")", "self", ".", "settings", ".", "general", ".", "set_string", "(", "'compat-backspace'", ",", "ERASE_BINDINGS", "[", "val", "]", ...
Changes the value of compat_backspace in dconf
[ "Changes", "the", "value", "of", "compat_backspace", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L640-L644
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_window_vertical_displacement_value_changed
def on_window_vertical_displacement_value_changed(self, spin): """Changes the value of window-vertical-displacement """ self.settings.general.set_int('window-vertical-displacement', int(spin.get_value()))
python
def on_window_vertical_displacement_value_changed(self, spin): """Changes the value of window-vertical-displacement """ self.settings.general.set_int('window-vertical-displacement', int(spin.get_value()))
[ "def", "on_window_vertical_displacement_value_changed", "(", "self", ",", "spin", ")", ":", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-vertical-displacement'", ",", "int", "(", "spin", ".", "get_value", "(", ")", ")", ")" ]
Changes the value of window-vertical-displacement
[ "Changes", "the", "value", "of", "window", "-", "vertical", "-", "displacement" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L691-L694
train
Guake/guake
guake/prefs.py
PrefsCallbacks.on_window_horizontal_displacement_value_changed
def on_window_horizontal_displacement_value_changed(self, spin): """Changes the value of window-horizontal-displacement """ self.settings.general.set_int('window-horizontal-displacement', int(spin.get_value()))
python
def on_window_horizontal_displacement_value_changed(self, spin): """Changes the value of window-horizontal-displacement """ self.settings.general.set_int('window-horizontal-displacement', int(spin.get_value()))
[ "def", "on_window_horizontal_displacement_value_changed", "(", "self", ",", "spin", ")", ":", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-horizontal-displacement'", ",", "int", "(", "spin", ".", "get_value", "(", ")", ")", ")" ]
Changes the value of window-horizontal-displacement
[ "Changes", "the", "value", "of", "window", "-", "horizontal", "-", "displacement" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L696-L699
train
Guake/guake
guake/prefs.py
PrefsDialog.toggle_use_font_background_sensitivity
def toggle_use_font_background_sensitivity(self, chk): """If the user chooses to use the gnome default font configuration it means that he will not be able to use the font selector. """ self.get_widget('palette_16').set_sensitive(chk.get_active()) self.get_widget('palette...
python
def toggle_use_font_background_sensitivity(self, chk): """If the user chooses to use the gnome default font configuration it means that he will not be able to use the font selector. """ self.get_widget('palette_16').set_sensitive(chk.get_active()) self.get_widget('palette...
[ "def", "toggle_use_font_background_sensitivity", "(", "self", ",", "chk", ")", ":", "self", ".", "get_widget", "(", "'palette_16'", ")", ".", "set_sensitive", "(", "chk", ".", "get_active", "(", ")", ")", "self", ".", "get_widget", "(", "'palette_17'", ")", ...
If the user chooses to use the gnome default font configuration it means that he will not be able to use the font selector.
[ "If", "the", "user", "chooses", "to", "use", "the", "gnome", "default", "font", "configuration", "it", "means", "that", "he", "will", "not", "be", "able", "to", "use", "the", "font", "selector", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L866-L872
train
Guake/guake
guake/prefs.py
PrefsDialog.toggle_quick_open_command_line_sensitivity
def toggle_quick_open_command_line_sensitivity(self, chk): """When the user unchecks 'enable quick open', the command line should be disabled """ self.get_widget('quick_open_command_line').set_sensitive(chk.get_active()) self.get_widget('quick_open_in_current_terminal').set_sensitive(chk...
python
def toggle_quick_open_command_line_sensitivity(self, chk): """When the user unchecks 'enable quick open', the command line should be disabled """ self.get_widget('quick_open_command_line').set_sensitive(chk.get_active()) self.get_widget('quick_open_in_current_terminal').set_sensitive(chk...
[ "def", "toggle_quick_open_command_line_sensitivity", "(", "self", ",", "chk", ")", ":", "self", ".", "get_widget", "(", "'quick_open_command_line'", ")", ".", "set_sensitive", "(", "chk", ".", "get_active", "(", ")", ")", "self", ".", "get_widget", "(", "'quick_...
When the user unchecks 'enable quick open', the command line should be disabled
[ "When", "the", "user", "unchecks", "enable", "quick", "open", "the", "command", "line", "should", "be", "disabled" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L880-L884
train
Guake/guake
guake/prefs.py
PrefsDialog.on_cursor_shape_changed
def on_cursor_shape_changed(self, combo): """Changes the value of cursor_shape in dconf """ index = combo.get_active() self.settings.style.set_int('cursor-shape', index)
python
def on_cursor_shape_changed(self, combo): """Changes the value of cursor_shape in dconf """ index = combo.get_active() self.settings.style.set_int('cursor-shape', index)
[ "def", "on_cursor_shape_changed", "(", "self", ",", "combo", ")", ":", "index", "=", "combo", ".", "get_active", "(", ")", "self", ".", "settings", ".", "style", ".", "set_int", "(", "'cursor-shape'", ",", "index", ")" ]
Changes the value of cursor_shape in dconf
[ "Changes", "the", "value", "of", "cursor_shape", "in", "dconf" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L918-L922
train
Guake/guake
guake/prefs.py
PrefsDialog.set_palette_name
def set_palette_name(self, palette_name): """If the given palette matches an existing one, shows it in the combobox """ combo = self.get_widget('palette_name') found = False log.debug("wanting palette: %r", palette_name) for i in combo.get_model(): if ...
python
def set_palette_name(self, palette_name): """If the given palette matches an existing one, shows it in the combobox """ combo = self.get_widget('palette_name') found = False log.debug("wanting palette: %r", palette_name) for i in combo.get_model(): if ...
[ "def", "set_palette_name", "(", "self", ",", "palette_name", ")", ":", "combo", "=", "self", ".", "get_widget", "(", "'palette_name'", ")", "found", "=", "False", "log", ".", "debug", "(", "\"wanting palette: %r\"", ",", "palette_name", ")", "for", "i", "in"...
If the given palette matches an existing one, shows it in the combobox
[ "If", "the", "given", "palette", "matches", "an", "existing", "one", "shows", "it", "in", "the", "combobox" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L944-L957
train
Guake/guake
guake/prefs.py
PrefsDialog.set_palette_colors
def set_palette_colors(self, palette): """Updates the color buttons with the given palette """ palette = palette.split(':') for i, pal in enumerate(palette): x, color = Gdk.Color.parse(pal) self.get_widget('palette_%d' % i).set_color(color)
python
def set_palette_colors(self, palette): """Updates the color buttons with the given palette """ palette = palette.split(':') for i, pal in enumerate(palette): x, color = Gdk.Color.parse(pal) self.get_widget('palette_%d' % i).set_color(color)
[ "def", "set_palette_colors", "(", "self", ",", "palette", ")", ":", "palette", "=", "palette", ".", "split", "(", "':'", ")", "for", "i", ",", "pal", "in", "enumerate", "(", "palette", ")", ":", "x", ",", "color", "=", "Gdk", ".", "Color", ".", "pa...
Updates the color buttons with the given palette
[ "Updates", "the", "color", "buttons", "with", "the", "given", "palette" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1000-L1006
train
Guake/guake
guake/prefs.py
PrefsDialog._load_hooks_settings
def _load_hooks_settings(self): """load hooks settings""" log.debug("executing _load_hooks_settings") hook_show_widget = self.get_widget("hook_show") hook_show_setting = self.settings.hooks.get_string("show") if hook_show_widget is not None: if hook_show_setting is no...
python
def _load_hooks_settings(self): """load hooks settings""" log.debug("executing _load_hooks_settings") hook_show_widget = self.get_widget("hook_show") hook_show_setting = self.settings.hooks.get_string("show") if hook_show_widget is not None: if hook_show_setting is no...
[ "def", "_load_hooks_settings", "(", "self", ")", ":", "log", ".", "debug", "(", "\"executing _load_hooks_settings\"", ")", "hook_show_widget", "=", "self", ".", "get_widget", "(", "\"hook_show\"", ")", "hook_show_setting", "=", "self", ".", "settings", ".", "hooks...
load hooks settings
[ "load", "hooks", "settings" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1028-L1035
train
Guake/guake
guake/prefs.py
PrefsDialog._load_screen_settings
def _load_screen_settings(self): """Load screen settings""" # display number / use primary display combo = self.get_widget('display_n') dest_screen = self.settings.general.get_int('display-n') # If Guake is configured to use a screen that is not currently attached, # defa...
python
def _load_screen_settings(self): """Load screen settings""" # display number / use primary display combo = self.get_widget('display_n') dest_screen = self.settings.general.get_int('display-n') # If Guake is configured to use a screen that is not currently attached, # defa...
[ "def", "_load_screen_settings", "(", "self", ")", ":", "# display number / use primary display", "combo", "=", "self", ".", "get_widget", "(", "'display_n'", ")", "dest_screen", "=", "self", ".", "settings", ".", "general", ".", "get_int", "(", "'display-n'", ")",...
Load screen settings
[ "Load", "screen", "settings" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1046-L1071
train
Guake/guake
guake/prefs.py
PrefsDialog.populate_keys_tree
def populate_keys_tree(self): """Reads the HOTKEYS global variable and insert all data in the TreeStore used by the preferences window treeview. """ for group in HOTKEYS: parent = self.store.append(None, [None, group['label'], None, None]) for item in group['keys'...
python
def populate_keys_tree(self): """Reads the HOTKEYS global variable and insert all data in the TreeStore used by the preferences window treeview. """ for group in HOTKEYS: parent = self.store.append(None, [None, group['label'], None, None]) for item in group['keys'...
[ "def", "populate_keys_tree", "(", "self", ")", ":", "for", "group", "in", "HOTKEYS", ":", "parent", "=", "self", ".", "store", ".", "append", "(", "None", ",", "[", "None", ",", "group", "[", "'label'", "]", ",", "None", ",", "None", "]", ")", "for...
Reads the HOTKEYS global variable and insert all data in the TreeStore used by the preferences window treeview.
[ "Reads", "the", "HOTKEYS", "global", "variable", "and", "insert", "all", "data", "in", "the", "TreeStore", "used", "by", "the", "preferences", "window", "treeview", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1340-L1355
train
Guake/guake
guake/prefs.py
PrefsDialog.populate_display_n
def populate_display_n(self): """Get the number of displays and populate this drop-down box with them all. Prepend the "always on primary" option. """ cb = self.get_widget('display_n') screen = self.get_widget('config-window').get_screen() cb.append_text("always on prima...
python
def populate_display_n(self): """Get the number of displays and populate this drop-down box with them all. Prepend the "always on primary" option. """ cb = self.get_widget('display_n') screen = self.get_widget('config-window').get_screen() cb.append_text("always on prima...
[ "def", "populate_display_n", "(", "self", ")", ":", "cb", "=", "self", ".", "get_widget", "(", "'display_n'", ")", "screen", "=", "self", ".", "get_widget", "(", "'config-window'", ")", ".", "get_screen", "(", ")", "cb", ".", "append_text", "(", "\"always ...
Get the number of displays and populate this drop-down box with them all. Prepend the "always on primary" option.
[ "Get", "the", "number", "of", "displays", "and", "populate", "this", "drop", "-", "down", "box", "with", "them", "all", ".", "Prepend", "the", "always", "on", "primary", "option", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1357-L1371
train
Guake/guake
guake/prefs.py
PrefsDialog.on_accel_cleared
def on_accel_cleared(self, cellrendereraccel, path): """If the user tries to clear a keybinding with the backspace key this callback will be called and it just fill the model with an empty key and set the 'disabled' string in dconf path. """ dconf_path = self.store[path][HOTKET_M...
python
def on_accel_cleared(self, cellrendereraccel, path): """If the user tries to clear a keybinding with the backspace key this callback will be called and it just fill the model with an empty key and set the 'disabled' string in dconf path. """ dconf_path = self.store[path][HOTKET_M...
[ "def", "on_accel_cleared", "(", "self", ",", "cellrendereraccel", ",", "path", ")", ":", "dconf_path", "=", "self", ".", "store", "[", "path", "]", "[", "HOTKET_MODEL_INDEX_DCONF", "]", "if", "dconf_path", "==", "\"show-hide\"", ":", "# cannot disable 'show-hide' ...
If the user tries to clear a keybinding with the backspace key this callback will be called and it just fill the model with an empty key and set the 'disabled' string in dconf path.
[ "If", "the", "user", "tries", "to", "clear", "a", "keybinding", "with", "the", "backspace", "key", "this", "callback", "will", "be", "called", "and", "it", "just", "fill", "the", "model", "with", "an", "empty", "key", "and", "set", "the", "disabled", "st...
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1438-L1455
train
Guake/guake
guake/prefs.py
PrefsDialog.start_editing
def start_editing(self, treeview, event): """Make the treeview grab the focus and start editing the cell that the user has clicked to avoid confusion with two or three clicks before editing a keybinding. Thanks to gnome-keybinding-properties.c =) """ x, y = int(event.x),...
python
def start_editing(self, treeview, event): """Make the treeview grab the focus and start editing the cell that the user has clicked to avoid confusion with two or three clicks before editing a keybinding. Thanks to gnome-keybinding-properties.c =) """ x, y = int(event.x),...
[ "def", "start_editing", "(", "self", ",", "treeview", ",", "event", ")", ":", "x", ",", "y", "=", "int", "(", "event", ".", "x", ")", ",", "int", "(", "event", ".", "y", ")", "ret", "=", "treeview", ".", "get_path_at_pos", "(", "x", ",", "y", "...
Make the treeview grab the focus and start editing the cell that the user has clicked to avoid confusion with two or three clicks before editing a keybinding. Thanks to gnome-keybinding-properties.c =)
[ "Make", "the", "treeview", "grab", "the", "focus", "and", "start", "editing", "the", "cell", "that", "the", "user", "has", "clicked", "to", "avoid", "confusion", "with", "two", "or", "three", "clicks", "before", "editing", "a", "keybinding", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1457-L1474
train
Guake/guake
guake/utils.py
save_tabs_when_changed
def save_tabs_when_changed(func): """Decorator for save-tabs-when-changed """ def wrapper(*args, **kwargs): func(*args, **kwargs) log.debug("mom, I've been called: %s %s", func.__name__, func) # Find me the Guake! clsname = args[0].__class__.__name__ g = None ...
python
def save_tabs_when_changed(func): """Decorator for save-tabs-when-changed """ def wrapper(*args, **kwargs): func(*args, **kwargs) log.debug("mom, I've been called: %s %s", func.__name__, func) # Find me the Guake! clsname = args[0].__class__.__name__ g = None ...
[ "def", "save_tabs_when_changed", "(", "func", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "func", "(", "*", "args", ",", "*", "*", "kwargs", ")", "log", ".", "debug", "(", "\"mom, I've been called: %s %s\"", ",", "f...
Decorator for save-tabs-when-changed
[ "Decorator", "for", "save", "-", "tabs", "-", "when", "-", "changed" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/utils.py#L58-L84
train
Guake/guake
guake/utils.py
RectCalculator.get_final_window_monitor
def get_final_window_monitor(cls, settings, window): """Gets the final screen number for the main window of guake. """ screen = window.get_screen() # fetch settings use_mouse = settings.general.get_boolean('mouse-display') dest_screen = settings.general.get_int('display...
python
def get_final_window_monitor(cls, settings, window): """Gets the final screen number for the main window of guake. """ screen = window.get_screen() # fetch settings use_mouse = settings.general.get_boolean('mouse-display') dest_screen = settings.general.get_int('display...
[ "def", "get_final_window_monitor", "(", "cls", ",", "settings", ",", "window", ")", ":", "screen", "=", "window", ".", "get_screen", "(", ")", "# fetch settings", "use_mouse", "=", "settings", ".", "general", ".", "get_boolean", "(", "'mouse-display'", ")", "d...
Gets the final screen number for the main window of guake.
[ "Gets", "the", "final", "screen", "number", "for", "the", "main", "window", "of", "guake", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/utils.py#L312-L341
train
Guake/guake
guake/dialogs.py
PromptQuitDialog.quit
def quit(self): """Run the "are you sure" dialog for quitting Guake """ # Stop an open "close tab" dialog from obstructing a quit response = self.run() == Gtk.ResponseType.YES self.destroy() # Keep Guake focussed after dismissing tab-close prompt # if tab == -1: ...
python
def quit(self): """Run the "are you sure" dialog for quitting Guake """ # Stop an open "close tab" dialog from obstructing a quit response = self.run() == Gtk.ResponseType.YES self.destroy() # Keep Guake focussed after dismissing tab-close prompt # if tab == -1: ...
[ "def", "quit", "(", "self", ")", ":", "# Stop an open \"close tab\" dialog from obstructing a quit", "response", "=", "self", ".", "run", "(", ")", "==", "Gtk", ".", "ResponseType", ".", "YES", "self", ".", "destroy", "(", ")", "# Keep Guake focussed after dismissin...
Run the "are you sure" dialog for quitting Guake
[ "Run", "the", "are", "you", "sure", "dialog", "for", "quitting", "Guake" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/dialogs.py#L70-L79
train
Guake/guake
guake/boxes.py
TerminalBox.set_terminal
def set_terminal(self, terminal): """Packs the terminal widget. """ if self.terminal is not None: raise RuntimeError("TerminalBox: terminal already set") self.terminal = terminal self.terminal.connect("grab-focus", self.on_terminal_focus) self.terminal.connect...
python
def set_terminal(self, terminal): """Packs the terminal widget. """ if self.terminal is not None: raise RuntimeError("TerminalBox: terminal already set") self.terminal = terminal self.terminal.connect("grab-focus", self.on_terminal_focus) self.terminal.connect...
[ "def", "set_terminal", "(", "self", ",", "terminal", ")", ":", "if", "self", ".", "terminal", "is", "not", "None", ":", "raise", "RuntimeError", "(", "\"TerminalBox: terminal already set\"", ")", "self", ".", "terminal", "=", "terminal", "self", ".", "terminal...
Packs the terminal widget.
[ "Packs", "the", "terminal", "widget", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/boxes.py#L309-L321
train
Guake/guake
guake/boxes.py
TerminalBox.add_scroll_bar
def add_scroll_bar(self): """Packs the scrollbar. """ adj = self.terminal.get_vadjustment() scroll = Gtk.VScrollbar(adj) scroll.show() self.pack_start(scroll, False, False, 0)
python
def add_scroll_bar(self): """Packs the scrollbar. """ adj = self.terminal.get_vadjustment() scroll = Gtk.VScrollbar(adj) scroll.show() self.pack_start(scroll, False, False, 0)
[ "def", "add_scroll_bar", "(", "self", ")", ":", "adj", "=", "self", ".", "terminal", ".", "get_vadjustment", "(", ")", "scroll", "=", "Gtk", ".", "VScrollbar", "(", "adj", ")", "scroll", ".", "show", "(", ")", "self", ".", "pack_start", "(", "scroll", ...
Packs the scrollbar.
[ "Packs", "the", "scrollbar", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/boxes.py#L323-L329
train
Guake/guake
guake/guake_app.py
Guake.execute_command
def execute_command(self, command, tab=None): # TODO DBUS_ONLY """Execute the `command' in the `tab'. If tab is None, the command will be executed in the currently selected tab. Command should end with '\n', otherwise it will be appended to the string. """ # TODO ...
python
def execute_command(self, command, tab=None): # TODO DBUS_ONLY """Execute the `command' in the `tab'. If tab is None, the command will be executed in the currently selected tab. Command should end with '\n', otherwise it will be appended to the string. """ # TODO ...
[ "def", "execute_command", "(", "self", ",", "command", ",", "tab", "=", "None", ")", ":", "# TODO DBUS_ONLY", "# TODO CONTEXTMENU this has to be rewriten and only serves the", "# dbus interface, maybe this should be moved to dbusinterface.py", "if", "not", "self", ".", "get_not...
Execute the `command' in the `tab'. If tab is None, the command will be executed in the currently selected tab. Command should end with '\n', otherwise it will be appended to the string.
[ "Execute", "the", "command", "in", "the", "tab", ".", "If", "tab", "is", "None", "the", "command", "will", "be", "executed", "in", "the", "currently", "selected", "tab", ".", "Command", "should", "end", "with", "\\", "n", "otherwise", "it", "will", "be",...
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L386-L402
train
Guake/guake
guake/guake_app.py
Guake.execute_command_by_uuid
def execute_command_by_uuid(self, tab_uuid, command): # TODO DBUS_ONLY """Execute the `command' in the tab whose terminal has the `tab_uuid' uuid """ if command[-1] != '\n': command += '\n' try: tab_uuid = uuid.UUID(tab_uuid) page_index, = ( ...
python
def execute_command_by_uuid(self, tab_uuid, command): # TODO DBUS_ONLY """Execute the `command' in the tab whose terminal has the `tab_uuid' uuid """ if command[-1] != '\n': command += '\n' try: tab_uuid = uuid.UUID(tab_uuid) page_index, = ( ...
[ "def", "execute_command_by_uuid", "(", "self", ",", "tab_uuid", ",", "command", ")", ":", "# TODO DBUS_ONLY", "if", "command", "[", "-", "1", "]", "!=", "'\\n'", ":", "command", "+=", "'\\n'", "try", ":", "tab_uuid", "=", "uuid", ".", "UUID", "(", "tab_u...
Execute the `command' in the tab whose terminal has the `tab_uuid' uuid
[ "Execute", "the", "command", "in", "the", "tab", "whose", "terminal", "has", "the", "tab_uuid", "uuid" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L404-L421
train
Guake/guake
guake/guake_app.py
Guake.on_window_losefocus
def on_window_losefocus(self, window, event): """Hides terminal main window when it loses the focus and if the window_losefocus gconf variable is True. """ if not HidePrevention(self.window).may_hide(): return value = self.settings.general.get_boolean('window-losefoc...
python
def on_window_losefocus(self, window, event): """Hides terminal main window when it loses the focus and if the window_losefocus gconf variable is True. """ if not HidePrevention(self.window).may_hide(): return value = self.settings.general.get_boolean('window-losefoc...
[ "def", "on_window_losefocus", "(", "self", ",", "window", ",", "event", ")", ":", "if", "not", "HidePrevention", "(", "self", ".", "window", ")", ".", "may_hide", "(", ")", ":", "return", "value", "=", "self", ".", "settings", ".", "general", ".", "get...
Hides terminal main window when it loses the focus and if the window_losefocus gconf variable is True.
[ "Hides", "terminal", "main", "window", "when", "it", "loses", "the", "focus", "and", "if", "the", "window_losefocus", "gconf", "variable", "is", "True", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L423-L435
train
Guake/guake
guake/guake_app.py
Guake.show_menu
def show_menu(self, status_icon, button, activate_time): """Show the tray icon menu. """ menu = self.get_widget('tray-menu') menu.popup(None, None, None, Gtk.StatusIcon.position_menu, button, activate_time)
python
def show_menu(self, status_icon, button, activate_time): """Show the tray icon menu. """ menu = self.get_widget('tray-menu') menu.popup(None, None, None, Gtk.StatusIcon.position_menu, button, activate_time)
[ "def", "show_menu", "(", "self", ",", "status_icon", ",", "button", ",", "activate_time", ")", ":", "menu", "=", "self", ".", "get_widget", "(", "'tray-menu'", ")", "menu", ".", "popup", "(", "None", ",", "None", ",", "None", ",", "Gtk", ".", "StatusIc...
Show the tray icon menu.
[ "Show", "the", "tray", "icon", "menu", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L437-L441
train
Guake/guake
guake/guake_app.py
Guake.show_hide
def show_hide(self, *args): """Toggles the main window visibility """ log.debug("Show_hide called") if self.forceHide: self.forceHide = False return if not HidePrevention(self.window).may_hide(): return if not self.win_prepare(): ...
python
def show_hide(self, *args): """Toggles the main window visibility """ log.debug("Show_hide called") if self.forceHide: self.forceHide = False return if not HidePrevention(self.window).may_hide(): return if not self.win_prepare(): ...
[ "def", "show_hide", "(", "self", ",", "*", "args", ")", ":", "log", ".", "debug", "(", "\"Show_hide called\"", ")", "if", "self", ".", "forceHide", ":", "self", ".", "forceHide", "=", "False", "return", "if", "not", "HidePrevention", "(", "self", ".", ...
Toggles the main window visibility
[ "Toggles", "the", "main", "window", "visibility" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L472-L518
train
Guake/guake
guake/guake_app.py
Guake.show
def show(self): """Shows the main window and grabs the focus on it. """ self.hidden = False # setting window in all desktops window_rect = RectCalculator.set_final_window_rect(self.settings, self.window) self.window.stick() # add tab must be called before windo...
python
def show(self): """Shows the main window and grabs the focus on it. """ self.hidden = False # setting window in all desktops window_rect = RectCalculator.set_final_window_rect(self.settings, self.window) self.window.stick() # add tab must be called before windo...
[ "def", "show", "(", "self", ")", ":", "self", ".", "hidden", "=", "False", "# setting window in all desktops", "window_rect", "=", "RectCalculator", ".", "set_final_window_rect", "(", "self", ".", "settings", ",", "self", ".", "window", ")", "self", ".", "wind...
Shows the main window and grabs the focus on it.
[ "Shows", "the", "main", "window", "and", "grabs", "the", "focus", "on", "it", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L568-L641
train
Guake/guake
guake/guake_app.py
Guake.hide
def hide(self): """Hides the main window of the terminal and sets the visible flag to False. """ if not HidePrevention(self.window).may_hide(): return self.hidden = True self.get_widget('window-root').unstick() self.window.hide()
python
def hide(self): """Hides the main window of the terminal and sets the visible flag to False. """ if not HidePrevention(self.window).may_hide(): return self.hidden = True self.get_widget('window-root').unstick() self.window.hide()
[ "def", "hide", "(", "self", ")", ":", "if", "not", "HidePrevention", "(", "self", ".", "window", ")", ".", "may_hide", "(", ")", ":", "return", "self", ".", "hidden", "=", "True", "self", ".", "get_widget", "(", "'window-root'", ")", ".", "unstick", ...
Hides the main window of the terminal and sets the visible flag to False.
[ "Hides", "the", "main", "window", "of", "the", "terminal", "and", "sets", "the", "visible", "flag", "to", "False", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L660-L668
train
Guake/guake
guake/guake_app.py
Guake.load_config
def load_config(self): """"Just a proxy for all the configuration stuff. """ self.settings.general.triggerOnChangedValue(self.settings.general, 'use-trayicon') self.settings.general.triggerOnChangedValue(self.settings.general, 'prompt-on-quit') self.settings.general.triggerOnCha...
python
def load_config(self): """"Just a proxy for all the configuration stuff. """ self.settings.general.triggerOnChangedValue(self.settings.general, 'use-trayicon') self.settings.general.triggerOnChangedValue(self.settings.general, 'prompt-on-quit') self.settings.general.triggerOnCha...
[ "def", "load_config", "(", "self", ")", ":", "self", ".", "settings", ".", "general", ".", "triggerOnChangedValue", "(", "self", ".", "settings", ".", "general", ",", "'use-trayicon'", ")", "self", ".", "settings", ".", "general", ".", "triggerOnChangedValue",...
Just a proxy for all the configuration stuff.
[ "Just", "a", "proxy", "for", "all", "the", "configuration", "stuff", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L681-L716
train
Guake/guake
guake/guake_app.py
Guake.accel_quit
def accel_quit(self, *args): """Callback to prompt the user whether to quit Guake or not. """ procs = self.notebook_manager.get_running_fg_processes_count() tabs = self.notebook_manager.get_n_pages() notebooks = self.notebook_manager.get_n_notebooks() prompt_cfg = self.se...
python
def accel_quit(self, *args): """Callback to prompt the user whether to quit Guake or not. """ procs = self.notebook_manager.get_running_fg_processes_count() tabs = self.notebook_manager.get_n_pages() notebooks = self.notebook_manager.get_n_notebooks() prompt_cfg = self.se...
[ "def", "accel_quit", "(", "self", ",", "*", "args", ")", ":", "procs", "=", "self", ".", "notebook_manager", ".", "get_running_fg_processes_count", "(", ")", "tabs", "=", "self", ".", "notebook_manager", ".", "get_n_pages", "(", ")", "notebooks", "=", "self"...
Callback to prompt the user whether to quit Guake or not.
[ "Callback", "to", "prompt", "the", "user", "whether", "to", "quit", "Guake", "or", "not", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L739-L755
train
Guake/guake
guake/guake_app.py
Guake.accel_reset_terminal
def accel_reset_terminal(self, *args): # TODO KEYBINDINGS ONLY """Callback to reset and clean the terminal""" HidePrevention(self.window).prevent() current_term = self.get_notebook().get_current_terminal() current_term.reset(True, True) HidePrevention(self.window).allow()...
python
def accel_reset_terminal(self, *args): # TODO KEYBINDINGS ONLY """Callback to reset and clean the terminal""" HidePrevention(self.window).prevent() current_term = self.get_notebook().get_current_terminal() current_term.reset(True, True) HidePrevention(self.window).allow()...
[ "def", "accel_reset_terminal", "(", "self", ",", "*", "args", ")", ":", "# TODO KEYBINDINGS ONLY", "HidePrevention", "(", "self", ".", "window", ")", ".", "prevent", "(", ")", "current_term", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_termin...
Callback to reset and clean the terminal
[ "Callback", "to", "reset", "and", "clean", "the", "terminal" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L757-L764
train
Guake/guake
guake/guake_app.py
Guake.accel_zoom_in
def accel_zoom_in(self, *args): """Callback to zoom in. """ for term in self.get_notebook().iter_terminals(): term.increase_font_size() return True
python
def accel_zoom_in(self, *args): """Callback to zoom in. """ for term in self.get_notebook().iter_terminals(): term.increase_font_size() return True
[ "def", "accel_zoom_in", "(", "self", ",", "*", "args", ")", ":", "for", "term", "in", "self", ".", "get_notebook", "(", ")", ".", "iter_terminals", "(", ")", ":", "term", ".", "increase_font_size", "(", ")", "return", "True" ]
Callback to zoom in.
[ "Callback", "to", "zoom", "in", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L766-L771
train
Guake/guake
guake/guake_app.py
Guake.accel_zoom_out
def accel_zoom_out(self, *args): """Callback to zoom out. """ for term in self.get_notebook().iter_terminals(): term.decrease_font_size() return True
python
def accel_zoom_out(self, *args): """Callback to zoom out. """ for term in self.get_notebook().iter_terminals(): term.decrease_font_size() return True
[ "def", "accel_zoom_out", "(", "self", ",", "*", "args", ")", ":", "for", "term", "in", "self", ".", "get_notebook", "(", ")", ".", "iter_terminals", "(", ")", ":", "term", ".", "decrease_font_size", "(", ")", "return", "True" ]
Callback to zoom out.
[ "Callback", "to", "zoom", "out", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L773-L778
train
Guake/guake
guake/guake_app.py
Guake.accel_increase_height
def accel_increase_height(self, *args): """Callback to increase height. """ height = self.settings.general.get_int('window-height') self.settings.general.set_int('window-height', min(height + 2, 100)) return True
python
def accel_increase_height(self, *args): """Callback to increase height. """ height = self.settings.general.get_int('window-height') self.settings.general.set_int('window-height', min(height + 2, 100)) return True
[ "def", "accel_increase_height", "(", "self", ",", "*", "args", ")", ":", "height", "=", "self", ".", "settings", ".", "general", ".", "get_int", "(", "'window-height'", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-height'", "...
Callback to increase height.
[ "Callback", "to", "increase", "height", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L780-L785
train
Guake/guake
guake/guake_app.py
Guake.accel_decrease_height
def accel_decrease_height(self, *args): """Callback to decrease height. """ height = self.settings.general.get_int('window-height') self.settings.general.set_int('window-height', max(height - 2, 0)) return True
python
def accel_decrease_height(self, *args): """Callback to decrease height. """ height = self.settings.general.get_int('window-height') self.settings.general.set_int('window-height', max(height - 2, 0)) return True
[ "def", "accel_decrease_height", "(", "self", ",", "*", "args", ")", ":", "height", "=", "self", ".", "settings", ".", "general", ".", "get_int", "(", "'window-height'", ")", "self", ".", "settings", ".", "general", ".", "set_int", "(", "'window-height'", "...
Callback to decrease height.
[ "Callback", "to", "decrease", "height", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L787-L792
train
Guake/guake
guake/guake_app.py
Guake.accel_increase_transparency
def accel_increase_transparency(self, *args): """Callback to increase transparency. """ transparency = self.settings.styleBackground.get_int('transparency') if int(transparency) - 2 > 0: self.settings.styleBackground.set_int('transparency', int(transparency) - 2) retu...
python
def accel_increase_transparency(self, *args): """Callback to increase transparency. """ transparency = self.settings.styleBackground.get_int('transparency') if int(transparency) - 2 > 0: self.settings.styleBackground.set_int('transparency', int(transparency) - 2) retu...
[ "def", "accel_increase_transparency", "(", "self", ",", "*", "args", ")", ":", "transparency", "=", "self", ".", "settings", ".", "styleBackground", ".", "get_int", "(", "'transparency'", ")", "if", "int", "(", "transparency", ")", "-", "2", ">", "0", ":",...
Callback to increase transparency.
[ "Callback", "to", "increase", "transparency", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L794-L800
train
Guake/guake
guake/guake_app.py
Guake.accel_decrease_transparency
def accel_decrease_transparency(self, *args): """Callback to decrease transparency. """ transparency = self.settings.styleBackground.get_int('transparency') if int(transparency) + 2 < MAX_TRANSPARENCY: self.settings.styleBackground.set_int('transparency', int(transparency) + ...
python
def accel_decrease_transparency(self, *args): """Callback to decrease transparency. """ transparency = self.settings.styleBackground.get_int('transparency') if int(transparency) + 2 < MAX_TRANSPARENCY: self.settings.styleBackground.set_int('transparency', int(transparency) + ...
[ "def", "accel_decrease_transparency", "(", "self", ",", "*", "args", ")", ":", "transparency", "=", "self", ".", "settings", ".", "styleBackground", ".", "get_int", "(", "'transparency'", ")", "if", "int", "(", "transparency", ")", "+", "2", "<", "MAX_TRANSP...
Callback to decrease transparency.
[ "Callback", "to", "decrease", "transparency", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L802-L808
train
Guake/guake
guake/guake_app.py
Guake.accel_toggle_transparency
def accel_toggle_transparency(self, *args): """Callback to toggle transparency. """ self.transparency_toggled = not self.transparency_toggled self.settings.styleBackground.triggerOnChangedValue( self.settings.styleBackground, 'transparency' ) return True
python
def accel_toggle_transparency(self, *args): """Callback to toggle transparency. """ self.transparency_toggled = not self.transparency_toggled self.settings.styleBackground.triggerOnChangedValue( self.settings.styleBackground, 'transparency' ) return True
[ "def", "accel_toggle_transparency", "(", "self", ",", "*", "args", ")", ":", "self", ".", "transparency_toggled", "=", "not", "self", ".", "transparency_toggled", "self", ".", "settings", ".", "styleBackground", ".", "triggerOnChangedValue", "(", "self", ".", "s...
Callback to toggle transparency.
[ "Callback", "to", "toggle", "transparency", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L810-L817
train
Guake/guake
guake/guake_app.py
Guake.accel_prev
def accel_prev(self, *args): """Callback to go to the previous tab. Called by the accel key. """ if self.get_notebook().get_current_page() == 0: self.get_notebook().set_current_page(self.get_notebook().get_n_pages() - 1) else: self.get_notebook().prev_page() ...
python
def accel_prev(self, *args): """Callback to go to the previous tab. Called by the accel key. """ if self.get_notebook().get_current_page() == 0: self.get_notebook().set_current_page(self.get_notebook().get_n_pages() - 1) else: self.get_notebook().prev_page() ...
[ "def", "accel_prev", "(", "self", ",", "*", "args", ")", ":", "if", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "==", "0", ":", "self", ".", "get_notebook", "(", ")", ".", "set_current_page", "(", "self", ".", "get_noteboo...
Callback to go to the previous tab. Called by the accel key.
[ "Callback", "to", "go", "to", "the", "previous", "tab", ".", "Called", "by", "the", "accel", "key", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L831-L838
train
Guake/guake
guake/guake_app.py
Guake.accel_next
def accel_next(self, *args): """Callback to go to the next tab. Called by the accel key. """ if self.get_notebook().get_current_page() + 1 == self.get_notebook().get_n_pages(): self.get_notebook().set_current_page(0) else: self.get_notebook().next_page() r...
python
def accel_next(self, *args): """Callback to go to the next tab. Called by the accel key. """ if self.get_notebook().get_current_page() + 1 == self.get_notebook().get_n_pages(): self.get_notebook().set_current_page(0) else: self.get_notebook().next_page() r...
[ "def", "accel_next", "(", "self", ",", "*", "args", ")", ":", "if", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "+", "1", "==", "self", ".", "get_notebook", "(", ")", ".", "get_n_pages", "(", ")", ":", "self", ".", "ge...
Callback to go to the next tab. Called by the accel key.
[ "Callback", "to", "go", "to", "the", "next", "tab", ".", "Called", "by", "the", "accel", "key", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L840-L847
train
Guake/guake
guake/guake_app.py
Guake.accel_move_tab_left
def accel_move_tab_left(self, *args): # TODO KEYBINDINGS ONLY """ Callback to move a tab to the left """ pos = self.get_notebook().get_current_page() if pos != 0: self.move_tab(pos, pos - 1) return True
python
def accel_move_tab_left(self, *args): # TODO KEYBINDINGS ONLY """ Callback to move a tab to the left """ pos = self.get_notebook().get_current_page() if pos != 0: self.move_tab(pos, pos - 1) return True
[ "def", "accel_move_tab_left", "(", "self", ",", "*", "args", ")", ":", "# TODO KEYBINDINGS ONLY", "pos", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "if", "pos", "!=", "0", ":", "self", ".", "move_tab", "(", "pos", ",",...
Callback to move a tab to the left
[ "Callback", "to", "move", "a", "tab", "to", "the", "left" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L849-L855
train
Guake/guake
guake/guake_app.py
Guake.accel_move_tab_right
def accel_move_tab_right(self, *args): # TODO KEYBINDINGS ONLY """ Callback to move a tab to the right """ pos = self.get_notebook().get_current_page() if pos != self.get_notebook().get_n_pages() - 1: self.move_tab(pos, pos + 1) return True
python
def accel_move_tab_right(self, *args): # TODO KEYBINDINGS ONLY """ Callback to move a tab to the right """ pos = self.get_notebook().get_current_page() if pos != self.get_notebook().get_n_pages() - 1: self.move_tab(pos, pos + 1) return True
[ "def", "accel_move_tab_right", "(", "self", ",", "*", "args", ")", ":", "# TODO KEYBINDINGS ONLY", "pos", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "if", "pos", "!=", "self", ".", "get_notebook", "(", ")", ".", "get_n_p...
Callback to move a tab to the right
[ "Callback", "to", "move", "a", "tab", "to", "the", "right" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L857-L863
train
Guake/guake
guake/guake_app.py
Guake.accel_rename_current_tab
def accel_rename_current_tab(self, *args): """Callback to show the rename tab dialog. Called by the accel key. """ page_num = self.get_notebook().get_current_page() page = self.get_notebook().get_nth_page(page_num) self.get_notebook().get_tab_label(page).on_rename(None) ...
python
def accel_rename_current_tab(self, *args): """Callback to show the rename tab dialog. Called by the accel key. """ page_num = self.get_notebook().get_current_page() page = self.get_notebook().get_nth_page(page_num) self.get_notebook().get_tab_label(page).on_rename(None) ...
[ "def", "accel_rename_current_tab", "(", "self", ",", "*", "args", ")", ":", "page_num", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "page", "=", "self", ".", "get_notebook", "(", ")", ".", "get_nth_page", "(", "page_num",...
Callback to show the rename tab dialog. Called by the accel key.
[ "Callback", "to", "show", "the", "rename", "tab", "dialog", ".", "Called", "by", "the", "accel", "key", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L886-L893
train
Guake/guake
guake/guake_app.py
Guake.accel_toggle_hide_on_lose_focus
def accel_toggle_hide_on_lose_focus(self, *args): """Callback toggle whether the window should hide when it loses focus. Called by the accel key. """ if self.settings.general.get_boolean('window-losefocus'): self.settings.general.set_boolean('window-losefocus', False) ...
python
def accel_toggle_hide_on_lose_focus(self, *args): """Callback toggle whether the window should hide when it loses focus. Called by the accel key. """ if self.settings.general.get_boolean('window-losefocus'): self.settings.general.set_boolean('window-losefocus', False) ...
[ "def", "accel_toggle_hide_on_lose_focus", "(", "self", ",", "*", "args", ")", ":", "if", "self", ".", "settings", ".", "general", ".", "get_boolean", "(", "'window-losefocus'", ")", ":", "self", ".", "settings", ".", "general", ".", "set_boolean", "(", "'win...
Callback toggle whether the window should hide when it loses focus. Called by the accel key.
[ "Callback", "toggle", "whether", "the", "window", "should", "hide", "when", "it", "loses", "focus", ".", "Called", "by", "the", "accel", "key", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L911-L919
train
Guake/guake
guake/guake_app.py
Guake.recompute_tabs_titles
def recompute_tabs_titles(self): """Updates labels on all tabs. This is required when `self.abbreviate` changes """ use_vte_titles = self.settings.general.get_boolean("use-vte-titles") if not use_vte_titles: return # TODO NOTEBOOK this code only works if ther...
python
def recompute_tabs_titles(self): """Updates labels on all tabs. This is required when `self.abbreviate` changes """ use_vte_titles = self.settings.general.get_boolean("use-vte-titles") if not use_vte_titles: return # TODO NOTEBOOK this code only works if ther...
[ "def", "recompute_tabs_titles", "(", "self", ")", ":", "use_vte_titles", "=", "self", ".", "settings", ".", "general", ".", "get_boolean", "(", "\"use-vte-titles\"", ")", "if", "not", "use_vte_titles", ":", "return", "# TODO NOTEBOOK this code only works if there is onl...
Updates labels on all tabs. This is required when `self.abbreviate` changes
[ "Updates", "labels", "on", "all", "tabs", ".", "This", "is", "required", "when", "self", ".", "abbreviate", "changes" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L933-L945
train
Guake/guake
guake/guake_app.py
Guake.compute_tab_title
def compute_tab_title(self, vte): """Abbreviate and cut vte terminal title when necessary """ vte_title = vte.get_window_title() or _("Terminal") try: current_directory = vte.get_current_directory() if self.abbreviate and vte_title.endswith(current_directory): ...
python
def compute_tab_title(self, vte): """Abbreviate and cut vte terminal title when necessary """ vte_title = vte.get_window_title() or _("Terminal") try: current_directory = vte.get_current_directory() if self.abbreviate and vte_title.endswith(current_directory): ...
[ "def", "compute_tab_title", "(", "self", ",", "vte", ")", ":", "vte_title", "=", "vte", ".", "get_window_title", "(", ")", "or", "_", "(", "\"Terminal\"", ")", "try", ":", "current_directory", "=", "vte", ".", "get_current_directory", "(", ")", "if", "self...
Abbreviate and cut vte terminal title when necessary
[ "Abbreviate", "and", "cut", "vte", "terminal", "title", "when", "necessary" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L947-L959
train
Guake/guake
guake/guake_app.py
Guake.close_tab
def close_tab(self, *args): """Closes the current tab. """ prompt_cfg = self.settings.general.get_int('prompt-on-close-tab') self.get_notebook().delete_page_current(prompt=prompt_cfg)
python
def close_tab(self, *args): """Closes the current tab. """ prompt_cfg = self.settings.general.get_int('prompt-on-close-tab') self.get_notebook().delete_page_current(prompt=prompt_cfg)
[ "def", "close_tab", "(", "self", ",", "*", "args", ")", ":", "prompt_cfg", "=", "self", ".", "settings", ".", "general", ".", "get_int", "(", "'prompt-on-close-tab'", ")", "self", ".", "get_notebook", "(", ")", ".", "delete_page_current", "(", "prompt", "=...
Closes the current tab.
[ "Closes", "the", "current", "tab", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L997-L1001
train
Guake/guake
guake/guake_app.py
Guake.rename_tab_uuid
def rename_tab_uuid(self, term_uuid, new_text, user_set=True): """Rename an already added tab by its UUID """ term_uuid = uuid.UUID(term_uuid) page_index, = ( index for index, t in enumerate(self.get_notebook().iter_terminals()) if t.get_uuid() == term_uuid ...
python
def rename_tab_uuid(self, term_uuid, new_text, user_set=True): """Rename an already added tab by its UUID """ term_uuid = uuid.UUID(term_uuid) page_index, = ( index for index, t in enumerate(self.get_notebook().iter_terminals()) if t.get_uuid() == term_uuid ...
[ "def", "rename_tab_uuid", "(", "self", ",", "term_uuid", ",", "new_text", ",", "user_set", "=", "True", ")", ":", "term_uuid", "=", "uuid", ".", "UUID", "(", "term_uuid", ")", "page_index", ",", "=", "(", "index", "for", "index", ",", "t", "in", "enume...
Rename an already added tab by its UUID
[ "Rename", "an", "already", "added", "tab", "by", "its", "UUID" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L1003-L1011
train
Guake/guake
guake/guake_app.py
Guake.get_selected_uuidtab
def get_selected_uuidtab(self): # TODO DBUS ONLY """Returns the uuid of the current selected terminal """ page_num = self.get_notebook().get_current_page() terminals = self.get_notebook().get_terminals_for_page(page_num) return str(terminals[0].get_uuid())
python
def get_selected_uuidtab(self): # TODO DBUS ONLY """Returns the uuid of the current selected terminal """ page_num = self.get_notebook().get_current_page() terminals = self.get_notebook().get_terminals_for_page(page_num) return str(terminals[0].get_uuid())
[ "def", "get_selected_uuidtab", "(", "self", ")", ":", "# TODO DBUS ONLY", "page_num", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_page", "(", ")", "terminals", "=", "self", ".", "get_notebook", "(", ")", ".", "get_terminals_for_page", "(", "p...
Returns the uuid of the current selected terminal
[ "Returns", "the", "uuid", "of", "the", "current", "selected", "terminal" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L1093-L1099
train
Guake/guake
guake/guake_app.py
Guake.search_on_web
def search_on_web(self, *args): """Search for the selected text on the web """ # TODO KEYBINDINGS ONLY current_term = self.get_notebook().get_current_terminal() if current_term.get_has_selection(): current_term.copy_clipboard() guake_clipboard = Gtk.Clipb...
python
def search_on_web(self, *args): """Search for the selected text on the web """ # TODO KEYBINDINGS ONLY current_term = self.get_notebook().get_current_terminal() if current_term.get_has_selection(): current_term.copy_clipboard() guake_clipboard = Gtk.Clipb...
[ "def", "search_on_web", "(", "self", ",", "*", "args", ")", ":", "# TODO KEYBINDINGS ONLY", "current_term", "=", "self", ".", "get_notebook", "(", ")", ".", "get_current_terminal", "(", ")", "if", "current_term", ".", "get_has_selection", "(", ")", ":", "curre...
Search for the selected text on the web
[ "Search", "for", "the", "selected", "text", "on", "the", "web" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L1101-L1117
train
Guake/guake
guake/guake_app.py
Guake.execute_hook
def execute_hook(self, event_name): """Execute shell commands related to current event_name""" hook = self.settings.hooks.get_string('{!s}'.format(event_name)) if hook is not None and hook != "": hook = hook.split() try: subprocess.Popen(hook) ...
python
def execute_hook(self, event_name): """Execute shell commands related to current event_name""" hook = self.settings.hooks.get_string('{!s}'.format(event_name)) if hook is not None and hook != "": hook = hook.split() try: subprocess.Popen(hook) ...
[ "def", "execute_hook", "(", "self", ",", "event_name", ")", ":", "hook", "=", "self", ".", "settings", ".", "hooks", ".", "get_string", "(", "'{!s}'", ".", "format", "(", "event_name", ")", ")", "if", "hook", "is", "not", "None", "and", "hook", "!=", ...
Execute shell commands related to current event_name
[ "Execute", "shell", "commands", "related", "to", "current", "event_name" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/guake_app.py#L1125-L1142
train
Guake/guake
guake/theme.py
get_resource_dirs
def get_resource_dirs(resource): """Returns a list of all known resource dirs for a given resource. :param str resource: Name of the resource (e.g. "themes") :return: A list of resource dirs """ dirs = [ os.path.join(dir, resource) for dir in itertools.chain(GLib.get...
python
def get_resource_dirs(resource): """Returns a list of all known resource dirs for a given resource. :param str resource: Name of the resource (e.g. "themes") :return: A list of resource dirs """ dirs = [ os.path.join(dir, resource) for dir in itertools.chain(GLib.get...
[ "def", "get_resource_dirs", "(", "resource", ")", ":", "dirs", "=", "[", "os", ".", "path", ".", "join", "(", "dir", ",", "resource", ")", "for", "dir", "in", "itertools", ".", "chain", "(", "GLib", ".", "get_system_data_dirs", "(", ")", ",", "GUAKE_TH...
Returns a list of all known resource dirs for a given resource. :param str resource: Name of the resource (e.g. "themes") :return: A list of resource dirs
[ "Returns", "a", "list", "of", "all", "known", "resource", "dirs", "for", "a", "given", "resource", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/theme.py#L22-L36
train
Guake/guake
guake/terminal.py
GuakeTerminal.configure_terminal
def configure_terminal(self): """Sets all customized properties on the terminal """ client = self.guake.settings.general word_chars = client.get_string('word-chars') if word_chars: self.set_word_char_exceptions(word_chars) self.set_audible_bell(client.get_bool...
python
def configure_terminal(self): """Sets all customized properties on the terminal """ client = self.guake.settings.general word_chars = client.get_string('word-chars') if word_chars: self.set_word_char_exceptions(word_chars) self.set_audible_bell(client.get_bool...
[ "def", "configure_terminal", "(", "self", ")", ":", "client", "=", "self", ".", "guake", ".", "settings", ".", "general", "word_chars", "=", "client", ".", "get_string", "(", "'word-chars'", ")", "if", "word_chars", ":", "self", ".", "set_word_char_exceptions"...
Sets all customized properties on the terminal
[ "Sets", "all", "customized", "properties", "on", "the", "terminal" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/terminal.py#L143-L172
train
Guake/guake
guake/terminal.py
GuakeTerminal.is_file_on_local_server
def is_file_on_local_server(self, text) -> Tuple[Optional[Path], Optional[int], Optional[int]]: """Test if the provided text matches a file on local server Supports: - absolute path - relative path (using current working directory) - file:line syntax - file:line:colu...
python
def is_file_on_local_server(self, text) -> Tuple[Optional[Path], Optional[int], Optional[int]]: """Test if the provided text matches a file on local server Supports: - absolute path - relative path (using current working directory) - file:line syntax - file:line:colu...
[ "def", "is_file_on_local_server", "(", "self", ",", "text", ")", "->", "Tuple", "[", "Optional", "[", "Path", "]", ",", "Optional", "[", "int", "]", ",", "Optional", "[", "int", "]", "]", ":", "lineno", "=", "None", "colno", "=", "None", "py_func", "...
Test if the provided text matches a file on local server Supports: - absolute path - relative path (using current working directory) - file:line syntax - file:line:colum syntax Args: text (str): candidate for file search Returns - Tu...
[ "Test", "if", "the", "provided", "text", "matches", "a", "file", "on", "local", "server" ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/terminal.py#L226-L297
train
Guake/guake
guake/terminal.py
GuakeTerminal.button_press
def button_press(self, terminal, event): """Handles the button press event in the terminal widget. If any match string is caught, another application is open to handle the matched resource uri. """ self.matched_value = '' if (Vte.MAJOR_VERSION, Vte.MINOR_VERSION) >= (0, 4...
python
def button_press(self, terminal, event): """Handles the button press event in the terminal widget. If any match string is caught, another application is open to handle the matched resource uri. """ self.matched_value = '' if (Vte.MAJOR_VERSION, Vte.MINOR_VERSION) >= (0, 4...
[ "def", "button_press", "(", "self", ",", "terminal", ",", "event", ")", ":", "self", ".", "matched_value", "=", "''", "if", "(", "Vte", ".", "MAJOR_VERSION", ",", "Vte", ".", "MINOR_VERSION", ")", ">=", "(", "0", ",", "46", ")", ":", "matched_string", ...
Handles the button press event in the terminal widget. If any match string is caught, another application is open to handle the matched resource uri.
[ "Handles", "the", "button", "press", "event", "in", "the", "terminal", "widget", ".", "If", "any", "match", "string", "is", "caught", "another", "application", "is", "open", "to", "handle", "the", "matched", "resource", "uri", "." ]
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/terminal.py#L299-L327
train
Guake/guake
guake/terminal.py
GuakeTerminal.delete_shell
def delete_shell(self, pid): """This function will kill the shell on a tab, trying to send a sigterm and if it doesn't work, a sigkill. Between these two signals, we have a timeout of 3 seconds, so is recommended to call this in another thread. This doesn't change any thing in UI...
python
def delete_shell(self, pid): """This function will kill the shell on a tab, trying to send a sigterm and if it doesn't work, a sigkill. Between these two signals, we have a timeout of 3 seconds, so is recommended to call this in another thread. This doesn't change any thing in UI...
[ "def", "delete_shell", "(", "self", ",", "pid", ")", ":", "try", ":", "os", ".", "kill", "(", "pid", ",", "signal", ".", "SIGHUP", ")", "except", "OSError", ":", "pass", "num_tries", "=", "30", "while", "num_tries", ">", "0", ":", "try", ":", "# Tr...
This function will kill the shell on a tab, trying to send a sigterm and if it doesn't work, a sigkill. Between these two signals, we have a timeout of 3 seconds, so is recommended to call this in another thread. This doesn't change any thing in UI, so you can use python's start_new_thre...
[ "This", "function", "will", "kill", "the", "shell", "on", "a", "tab", "trying", "to", "send", "a", "sigterm", "and", "if", "it", "doesn", "t", "work", "a", "sigkill", ".", "Between", "these", "two", "signals", "we", "have", "a", "timeout", "of", "3", ...
4153ef38f9044cbed6494075fce80acd5809df2b
https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/terminal.py#L463-L495
train
graphql-python/graphql-core
graphql/utils/is_valid_value.py
is_valid_value
def is_valid_value(value, type): # type: (Any, Any) -> List """Given a type and any value, return True if that value is valid.""" if isinstance(type, GraphQLNonNull): of_type = type.of_type if value is None: return [u'Expected "{}", found null.'.format(type)] return is_v...
python
def is_valid_value(value, type): # type: (Any, Any) -> List """Given a type and any value, return True if that value is valid.""" if isinstance(type, GraphQLNonNull): of_type = type.of_type if value is None: return [u'Expected "{}", found null.'.format(type)] return is_v...
[ "def", "is_valid_value", "(", "value", ",", "type", ")", ":", "# type: (Any, Any) -> List", "if", "isinstance", "(", "type", ",", "GraphQLNonNull", ")", ":", "of_type", "=", "type", ".", "of_type", "if", "value", "is", "None", ":", "return", "[", "u'Expected...
Given a type and any value, return True if that value is valid.
[ "Given", "a", "type", "and", "any", "value", "return", "True", "if", "that", "value", "is", "valid", "." ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/utils/is_valid_value.py#L28-L82
train
graphql-python/graphql-core
graphql/backend/cache.py
get_unique_schema_id
def get_unique_schema_id(schema): # type: (GraphQLSchema) -> str """Get a unique id given a GraphQLSchema""" assert isinstance(schema, GraphQLSchema), ( "Must receive a GraphQLSchema as schema. Received {}" ).format(repr(schema)) if schema not in _cached_schemas: _cached_schemas[sch...
python
def get_unique_schema_id(schema): # type: (GraphQLSchema) -> str """Get a unique id given a GraphQLSchema""" assert isinstance(schema, GraphQLSchema), ( "Must receive a GraphQLSchema as schema. Received {}" ).format(repr(schema)) if schema not in _cached_schemas: _cached_schemas[sch...
[ "def", "get_unique_schema_id", "(", "schema", ")", ":", "# type: (GraphQLSchema) -> str", "assert", "isinstance", "(", "schema", ",", "GraphQLSchema", ")", ",", "(", "\"Must receive a GraphQLSchema as schema. Received {}\"", ")", ".", "format", "(", "repr", "(", "schema...
Get a unique id given a GraphQLSchema
[ "Get", "a", "unique", "id", "given", "a", "GraphQLSchema" ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/backend/cache.py#L18-L27
train
graphql-python/graphql-core
graphql/backend/cache.py
get_unique_document_id
def get_unique_document_id(query_str): # type: (str) -> str """Get a unique id given a query_string""" assert isinstance(query_str, string_types), ( "Must receive a string as query_str. Received {}" ).format(repr(query_str)) if query_str not in _cached_queries: _cached_queries[query...
python
def get_unique_document_id(query_str): # type: (str) -> str """Get a unique id given a query_string""" assert isinstance(query_str, string_types), ( "Must receive a string as query_str. Received {}" ).format(repr(query_str)) if query_str not in _cached_queries: _cached_queries[query...
[ "def", "get_unique_document_id", "(", "query_str", ")", ":", "# type: (str) -> str", "assert", "isinstance", "(", "query_str", ",", "string_types", ")", ",", "(", "\"Must receive a string as query_str. Received {}\"", ")", ".", "format", "(", "repr", "(", "query_str", ...
Get a unique id given a query_string
[ "Get", "a", "unique", "id", "given", "a", "query_string" ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/backend/cache.py#L30-L39
train
graphql-python/graphql-core
graphql/backend/cache.py
GraphQLCachedBackend.get_key_for_schema_and_document_string
def get_key_for_schema_and_document_string(self, schema, request_string): # type: (GraphQLSchema, str) -> int """This method returns a unique key given a schema and a request_string""" if self.use_consistent_hash: schema_id = get_unique_schema_id(schema) document_id = get...
python
def get_key_for_schema_and_document_string(self, schema, request_string): # type: (GraphQLSchema, str) -> int """This method returns a unique key given a schema and a request_string""" if self.use_consistent_hash: schema_id = get_unique_schema_id(schema) document_id = get...
[ "def", "get_key_for_schema_and_document_string", "(", "self", ",", "schema", ",", "request_string", ")", ":", "# type: (GraphQLSchema, str) -> int", "if", "self", ".", "use_consistent_hash", ":", "schema_id", "=", "get_unique_schema_id", "(", "schema", ")", "document_id",...
This method returns a unique key given a schema and a request_string
[ "This", "method", "returns", "a", "unique", "key", "given", "a", "schema", "and", "a", "request_string" ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/backend/cache.py#L62-L69
train
graphql-python/graphql-core
graphql/validation/rules/fields_on_correct_type.py
get_suggested_type_names
def get_suggested_type_names(schema, output_type, field_name): """Go through all of the implementations of type, as well as the interfaces that they implement. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with Interfaces.""" ...
python
def get_suggested_type_names(schema, output_type, field_name): """Go through all of the implementations of type, as well as the interfaces that they implement. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with Interfaces.""" ...
[ "def", "get_suggested_type_names", "(", "schema", ",", "output_type", ",", "field_name", ")", ":", "if", "isinstance", "(", "output_type", ",", "(", "GraphQLInterfaceType", ",", "GraphQLUnionType", ")", ")", ":", "suggested_object_types", "=", "[", "]", "interface...
Go through all of the implementations of type, as well as the interfaces that they implement. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with Interfaces.
[ "Go", "through", "all", "of", "the", "implementations", "of", "type", "as", "well", "as", "the", "interfaces", "that", "they", "implement", ".", "If", "any", "of", "those", "types", "include", "the", "provided", "field", "suggest", "them", "sorted", "by", ...
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/validation/rules/fields_on_correct_type.py#L91-L128
train
graphql-python/graphql-core
graphql/validation/rules/fields_on_correct_type.py
get_suggested_field_names
def get_suggested_field_names(schema, graphql_type, field_name): """For the field name provided, determine if there are any similar field names that may be the result of a typo.""" if isinstance(graphql_type, (GraphQLInterfaceType, GraphQLObjectType)): possible_field_names = list(graphql_type.field...
python
def get_suggested_field_names(schema, graphql_type, field_name): """For the field name provided, determine if there are any similar field names that may be the result of a typo.""" if isinstance(graphql_type, (GraphQLInterfaceType, GraphQLObjectType)): possible_field_names = list(graphql_type.field...
[ "def", "get_suggested_field_names", "(", "schema", ",", "graphql_type", ",", "field_name", ")", ":", "if", "isinstance", "(", "graphql_type", ",", "(", "GraphQLInterfaceType", ",", "GraphQLObjectType", ")", ")", ":", "possible_field_names", "=", "list", "(", "grap...
For the field name provided, determine if there are any similar field names that may be the result of a typo.
[ "For", "the", "field", "name", "provided", "determine", "if", "there", "are", "any", "similar", "field", "names", "that", "may", "be", "the", "result", "of", "a", "typo", "." ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/validation/rules/fields_on_correct_type.py#L131-L141
train
graphql-python/graphql-core
graphql/backend/compiled.py
GraphQLCompiledDocument.from_code
def from_code( cls, schema, # type: GraphQLSchema code, # type: Union[str, Any] uptodate=None, # type: Optional[bool] extra_namespace=None, # type: Optional[Dict[str, Any]] ): # type: (...) -> GraphQLCompiledDocument """Creates a GraphQLDocument object fro...
python
def from_code( cls, schema, # type: GraphQLSchema code, # type: Union[str, Any] uptodate=None, # type: Optional[bool] extra_namespace=None, # type: Optional[Dict[str, Any]] ): # type: (...) -> GraphQLCompiledDocument """Creates a GraphQLDocument object fro...
[ "def", "from_code", "(", "cls", ",", "schema", ",", "# type: GraphQLSchema", "code", ",", "# type: Union[str, Any]", "uptodate", "=", "None", ",", "# type: Optional[bool]", "extra_namespace", "=", "None", ",", "# type: Optional[Dict[str, Any]]", ")", ":", "# type: (...)...
Creates a GraphQLDocument object from compiled code and the globals. This is used by the loaders and schema to create a document object.
[ "Creates", "a", "GraphQLDocument", "object", "from", "compiled", "code", "and", "the", "globals", ".", "This", "is", "used", "by", "the", "loaders", "and", "schema", "to", "create", "a", "document", "object", "." ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/backend/compiled.py#L12-L32
train
graphql-python/graphql-core
graphql/utils/suggestion_list.py
suggestion_list
def suggestion_list(inp, options): """ Given an invalid input string and a list of valid options, returns a filtered list of valid options sorted based on their similarity with the input. """ options_by_distance = OrderedDict() input_threshold = len(inp) / 2 for option in options: ...
python
def suggestion_list(inp, options): """ Given an invalid input string and a list of valid options, returns a filtered list of valid options sorted based on their similarity with the input. """ options_by_distance = OrderedDict() input_threshold = len(inp) / 2 for option in options: ...
[ "def", "suggestion_list", "(", "inp", ",", "options", ")", ":", "options_by_distance", "=", "OrderedDict", "(", ")", "input_threshold", "=", "len", "(", "inp", ")", "/", "2", "for", "option", "in", "options", ":", "distance", "=", "lexical_distance", "(", ...
Given an invalid input string and a list of valid options, returns a filtered list of valid options sorted based on their similarity with the input.
[ "Given", "an", "invalid", "input", "string", "and", "a", "list", "of", "valid", "options", "returns", "a", "filtered", "list", "of", "valid", "options", "sorted", "based", "on", "their", "similarity", "with", "the", "input", "." ]
d8e9d3abe7c209eb2f51cf001402783bfd480596
https://github.com/graphql-python/graphql-core/blob/d8e9d3abe7c209eb2f51cf001402783bfd480596/graphql/utils/suggestion_list.py#L4-L20
train