input
stringlengths 11
5.29k
| target
stringlengths 20
8.26k
|
---|---|
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def morphFeatures (self, AF):
"LEMMA,CAT,GEN,NUM,PER,CASE,VIB,TAM"
assert len(AF[:-1].split(",")) == 8 # no need to process trash! FIXME
lemma_,cat_,gen_,num_,per_,case_,vib_,tam_ = AF.split(",")
if len(lemma_) > 1: lemma_ = lemma_.strip("'")
return lemma_.strip("'"),cat_,gen_,num_,per_,case_,vib_,tam_.strip("'") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_fans(fans):
return format_line(prefix='fans'.rjust(RJUST), values=fans) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_tmps(tmps):
return format_line(prefix='temps'.rjust(RJUST), values=tmps) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_names(names):
return format_line(prefix='names'.rjust(RJUST), values=names) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_ports(ports):
return format_line(prefix='ports'.rjust(RJUST), values=ports) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_temps(temps):
return format_line(prefix='temps'.rjust(RJUST), values=temps) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_ambients(ambients):
return format_line(prefix='ambients'.rjust(RJUST), values=ambients) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_buffers(buffers):
return format_line(prefix='buffers'.rjust(RJUST), values=buffers) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_headrooms(headrooms):
return format_line(prefix='headrooms'.rjust(RJUST), values=headrooms) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_directions(directions):
return format_line(prefix='directions'.rjust(RJUST), values=directions) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_differences(differences):
return format_line(prefix='differences'.rjust(RJUST), values=differences) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def format_pwms_new(pwms_new):
return format_line(prefix='new pwms'.rjust(RJUST), values=pwms_new) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def add_custom_versions(versions):
''' create custom versions strings '''
versions_dict = {}
for tech, version in versions.items():
# clean up "-" from version
if "-" in version:
version = version.split("-")[0]
if version.startswith('v'):
versions_dict[tech + '_numeric'] = version[1:].split('+')[0]
# "v3.3.0.33" is what we have, we want "3.3"
versions_dict[tech + '_short'] = version[1:4]
return versions_dict |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def stringify(self, ascommalist=''):
''' return the options hash as cli params in a string
if ascommalist is set to the name of a key, and
the value of that key is a dict, format the dict
as a list of comma delimited key=value pairs '''
rval = []
for key in sorted(self.config_options.keys()):
data = self.config_options[key]
if data['include'] \
and (data['value'] or isinstance(data['value'], int)):
if key == ascommalist:
val = ','.join(['{}={}'.format(kk, vv) for kk, vv in sorted(data['value'].items())])
else:
val = data['value']
rval.append('--{}={}'.format(key.replace('_', '-'), val))
return rval |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def go():
to_unicode_processor_factory('utf8') |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def ToString(self):
"""Overwrite .NET ToString method."""
return self.__repr__() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __repr__(self):
"""Analemma representation."""
return 'Analemma: #%d' % len(self.sun_vectors) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def hexstr(s):
import string
h = string.hexdigits
r = ''
for c in s:
i = ord(c)
r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
return r |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self, reddit, term, config, oauth, url=None, submission=None):
super(SubmissionPage, self).__init__(reddit, term, config, oauth)
self.controller = SubmissionController(self, keymap=config.keymap)
if url:
self.content = SubmissionContent.from_url(
reddit, url, term.loader,
max_comment_cols=config['max_comment_cols'])
else:
self.content = SubmissionContent(
submission, term.loader,
max_comment_cols=config['max_comment_cols'])
# Start at the submission post, which is indexed as -1
self.nav = Navigator(self.content.get, page_index=-1)
self.selected_subreddit = None |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def toggle_comment(self):
"Toggle the selected comment tree between visible and hidden"
current_index = self.nav.absolute_index
self.content.toggle(current_index)
# This logic handles a display edge case after a comment toggle. We
# want to make sure that when we re-draw the page, the cursor stays at
# its current absolute position on the screen. In order to do this,
# apply a fixed offset if, while inverted, we either try to hide the
# bottom comment or toggle any of the middle comments.
if self.nav.inverted:
data = self.content.get(current_index)
if data['hidden'] or self.nav.cursor_index != 0:
window = self._subwindows[-1][0]
n_rows, _ = window.getmaxyx()
self.nav.flip(len(self._subwindows) - 1)
self.nav.top_item_height = n_rows |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def prompt_subreddit(self):
"Open a prompt to navigate to a different subreddit"
name = self.term.prompt_input('Enter page: /')
if name is not None:
with self.term.loader('Loading page'):
content = SubredditContent.from_name(
self.reddit, name, self.term.loader)
if not self.term.loader.exception:
self.selected_subreddit = content
self.active = False |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def comment_urlview(self):
data = self.get_selected_item()
comment = data.get('body') or data.get('text') or data.get('url_full')
if comment:
self.term.open_urlview(comment)
else:
self.term.flash() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def current_label_index(self):
return self.ui.comboBoxFuzzingLabel.currentIndex() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def create_connects(self):
self.ui.spinBoxFuzzingStart.valueChanged.connect(self.on_fuzzing_start_changed)
self.ui.spinBoxFuzzingEnd.valueChanged.connect(self.on_fuzzing_end_changed)
self.ui.comboBoxFuzzingLabel.currentIndexChanged.connect(self.on_combo_box_fuzzing_label_current_index_changed)
self.ui.btnRepeatValues.clicked.connect(self.on_btn_repeat_values_clicked)
self.ui.btnAddRow.clicked.connect(self.on_btn_add_row_clicked)
self.ui.btnDelRow.clicked.connect(self.on_btn_del_row_clicked)
self.ui.tblFuzzingValues.deletion_wanted.connect(self.delete_lines)
self.ui.chkBRemoveDuplicates.stateChanged.connect(self.on_remove_duplicates_state_changed)
self.ui.sBAddRangeStart.valueChanged.connect(self.on_fuzzing_range_start_changed)
self.ui.sBAddRangeEnd.valueChanged.connect(self.on_fuzzing_range_end_changed)
self.ui.checkBoxLowerBound.stateChanged.connect(self.on_lower_bound_checked_changed)
self.ui.checkBoxUpperBound.stateChanged.connect(self.on_upper_bound_checked_changed)
self.ui.spinBoxLowerBound.valueChanged.connect(self.on_lower_bound_changed)
self.ui.spinBoxUpperBound.valueChanged.connect(self.on_upper_bound_changed)
self.ui.spinBoxRandomMinimum.valueChanged.connect(self.on_random_range_min_changed)
self.ui.spinBoxRandomMaximum.valueChanged.connect(self.on_random_range_max_changed)
self.ui.spinBoxFuzzMessage.valueChanged.connect(self.on_fuzz_msg_changed)
self.ui.btnAddFuzzingValues.clicked.connect(self.on_btn_add_fuzzing_values_clicked)
self.ui.comboBoxFuzzingLabel.editTextChanged.connect(self.set_current_label_name) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def on_lower_bound_checked_changed(self):
if self.ui.checkBoxLowerBound.isChecked():
self.ui.spinBoxLowerBound.setEnabled(True)
self.ui.spinBoxBoundaryNumber.setEnabled(True)
elif not self.ui.checkBoxUpperBound.isChecked():
self.ui.spinBoxLowerBound.setEnabled(False)
self.ui.spinBoxBoundaryNumber.setEnabled(False)
else:
self.ui.spinBoxLowerBound.setEnabled(False) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def on_upper_bound_checked_changed(self):
if self.ui.checkBoxUpperBound.isChecked():
self.ui.spinBoxUpperBound.setEnabled(True)
self.ui.spinBoxBoundaryNumber.setEnabled(True)
elif not self.ui.checkBoxLowerBound.isChecked():
self.ui.spinBoxUpperBound.setEnabled(False)
self.ui.spinBoxBoundaryNumber.setEnabled(False)
else:
self.ui.spinBoxUpperBound.setEnabled(False) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def set_current_label_name(self):
self.current_label.name = self.ui.comboBoxFuzzingLabel.currentText()
self.ui.comboBoxFuzzingLabel.setItemText(self.ui.comboBoxFuzzingLabel.currentIndex(), self.current_label.name) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def on_fuzz_msg_changed(self, index: int):
self.ui.comboBoxFuzzingLabel.setDisabled(False)
sel_label_ind = self.ui.comboBoxFuzzingLabel.currentIndex()
self.ui.comboBoxFuzzingLabel.blockSignals(True)
self.ui.comboBoxFuzzingLabel.clear()
if len(self.message.message_type) == 0:
self.ui.comboBoxFuzzingLabel.setDisabled(True)
return
self.ui.comboBoxFuzzingLabel.addItems([lbl.name for lbl in self.message.message_type])
self.ui.comboBoxFuzzingLabel.blockSignals(False)
if sel_label_ind < self.ui.comboBoxFuzzingLabel.count():
self.ui.comboBoxFuzzingLabel.setCurrentIndex(sel_label_ind)
else:
self.ui.comboBoxFuzzingLabel.setCurrentIndex(0)
self.fuzz_table_model.fuzzing_label = self.current_label
self.fuzz_table_model.update()
self.update_message_data_string() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def opengl_lamp_buttons(column, lamp):
split = column.row()
split.prop(lamp, "use", text="", icon='OUTLINER_OB_LAMP' if lamp.use else 'LAMP_DATA')
col = split.column()
col.active = lamp.use
row = col.row()
row.label(text="Diffuse:")
row.prop(lamp, "diffuse_color", text="")
row = col.row()
row.label(text="Specular:")
row.prop(lamp, "specular_color", text="")
col = split.column()
col.active = lamp.use
col.prop(lamp, "direction", text="") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
layout.template_header()
userpref = context.user_preferences
layout.operator_context = 'EXEC_AREA'
layout.operator("wm.save_userpref")
layout.operator_context = 'INVOKE_DEFAULT'
if userpref.active_section == 'INPUT':
layout.operator("wm.keyconfig_import")
layout.operator("wm.keyconfig_export")
elif userpref.active_section == 'ADDONS':
layout.operator("wm.addon_install", icon='FILESEL')
layout.operator("wm.addon_refresh", icon='FILE_REFRESH')
layout.menu("USERPREF_MT_addons_online_resources")
elif userpref.active_section == 'THEMES':
layout.operator("ui.reset_default_theme")
layout.operator("wm.theme_install") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
userpref = context.user_preferences
layout.prop(userpref, "active_section", expand=True) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
split = layout.split()
row = split.row()
row.label("")
row = split.row()
row.label("Interaction:")
text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
if not text:
text = "Blender (default)"
row.menu("USERPREF_MT_appconfigs", text=text) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
import sys
layout = self.layout
userpref = context.user_preferences
view = userpref.view
row = layout.row()
col = row.column()
col.label(text="Display:")
col.prop(view, "show_tooltips")
col.prop(view, "show_tooltips_python")
col.prop(view, "show_object_info", text="Object Info")
col.prop(view, "show_large_cursors")
col.prop(view, "show_view_name", text="View Name")
col.prop(view, "show_playback_fps", text="Playback FPS")
col.prop(view, "use_global_scene")
col.prop(view, "object_origin_size")
col.separator()
col.separator()
col.separator()
col.prop(view, "show_mini_axis", text="Display Mini Axis")
sub = col.column()
sub.active = view.show_mini_axis
sub.prop(view, "mini_axis_size", text="Size")
sub.prop(view, "mini_axis_brightness", text="Brightness")
col.separator()
if sys.platform[:3] == "win":
col.label("Warnings")
col.prop(view, "use_quit_dialog")
row.separator()
row.separator()
col = row.column()
col.label(text="View Manipulation:")
col.prop(view, "use_mouse_depth_cursor")
col.prop(view, "use_mouse_depth_navigate")
col.prop(view, "use_zoom_to_mouse")
col.prop(view, "use_rotate_around_active")
col.prop(view, "use_global_pivot")
col.prop(view, "use_camera_lock_parent")
col.separator()
col.prop(view, "use_auto_perspective")
col.prop(view, "smooth_view")
col.prop(view, "rotation_angle")
col.separator()
col.separator()
col.label(text="2D Viewports:")
col.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
col.prop(view, "timecode_style")
col.prop(view, "view_frame_type")
if (view.view_frame_type == 'SECONDS'):
col.prop(view, "view_frame_seconds")
elif (view.view_frame_type == 'KEYFRAMES'):
col.prop(view, "view_frame_keyframes")
row.separator()
row.separator()
col = row.column()
#Toolbox doesn't exist yet
#col.label(text="Toolbox:")
#col.prop(view, "show_column_layout")
#col.label(text="Open Toolbox Delay:")
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
col.prop(view, "show_manipulator")
sub = col.column()
sub.active = view.show_manipulator
sub.prop(view, "manipulator_size", text="Size")
sub.prop(view, "manipulator_handle_size", text="Handle Size")
sub.prop(view, "manipulator_hotspot", text="Hotspot")
col.separator()
col.separator()
col.separator()
col.label(text="Menus:")
col.prop(view, "use_mouse_over_open")
sub = col.column()
sub.active = view.use_mouse_over_open
sub.prop(view, "open_toplevel_delay", text="Top Level")
sub.prop(view, "open_sublevel_delay", text="Sub Level")
col.separator()
col.label(text="Pie Menus:")
sub = col.column(align=True)
sub.prop(view, "pie_animation_timeout")
sub.prop(view, "pie_initial_timeout")
sub.prop(view, "pie_menu_radius")
sub.prop(view, "pie_menu_threshold")
sub.prop(view, "pie_menu_confirm")
col.separator()
col.separator()
col.separator()
col.prop(view, "show_splash") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
userpref = context.user_preferences
edit = userpref.edit
row = layout.row()
col = row.column()
col.label(text="Link Materials To:")
col.prop(edit, "material_link", text="")
col.separator()
col.separator()
col.separator()
col.label(text="New Objects:")
col.prop(edit, "use_enter_edit_mode")
col.label(text="Align To:")
col.prop(edit, "object_align", text="")
col.separator()
col.separator()
col.separator()
col.label(text="Undo:")
col.prop(edit, "use_global_undo")
col.prop(edit, "undo_steps", text="Steps")
col.prop(edit, "undo_memory_limit", text="Memory Limit")
row.separator()
row.separator()
col = row.column()
col.label(text="Grease Pencil:")
col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
col.separator()
col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
col.separator()
col.prop(edit, "grease_pencil_default_color", text="Default Color")
col.separator()
col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke")
col.separator()
col.separator()
col.separator()
col.separator()
col.label(text="Playback:")
col.prop(edit, "use_negative_frames")
col.separator()
col.separator()
col.separator()
col.label(text="Node Editor:")
col.prop(edit, "node_margin")
col.label(text="Animation Editors:")
col.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility")
row.separator()
row.separator()
col = row.column()
col.label(text="Keyframing:")
col.prop(edit, "use_visual_keying")
col.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
col.separator()
col.prop(edit, "use_auto_keying", text="Auto Keyframing:")
col.prop(edit, "use_auto_keying_warning")
sub = col.column()
#~ sub.active = edit.use_keyframe_insert_auto # incorrect, time-line can enable
sub.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
col.separator()
col.label(text="New F-Curve Defaults:")
col.prop(edit, "keyframe_new_interpolation_type", text="Interpolation")
col.prop(edit, "keyframe_new_handle_type", text="Handles")
col.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB")
col.separator()
col.separator()
col.separator()
col.label(text="Transform:")
col.prop(edit, "use_drag_immediately")
row.separator()
row.separator()
col = row.column()
col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
col.separator()
col.separator()
col.separator()
col.label(text="Duplicate Data:")
col.prop(edit, "use_duplicate_mesh", text="Mesh")
col.prop(edit, "use_duplicate_surface", text="Surface")
col.prop(edit, "use_duplicate_curve", text="Curve")
col.prop(edit, "use_duplicate_text", text="Text")
col.prop(edit, "use_duplicate_metaball", text="Metaball")
col.prop(edit, "use_duplicate_armature", text="Armature")
col.prop(edit, "use_duplicate_lamp", text="Lamp")
col.prop(edit, "use_duplicate_material", text="Material")
col.prop(edit, "use_duplicate_texture", text="Texture")
#col.prop(edit, "use_duplicate_fcurve", text="F-Curve")
col.prop(edit, "use_duplicate_action", text="Action")
col.prop(edit, "use_duplicate_particle", text="Particle") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
import sys
layout = self.layout
userpref = context.user_preferences
system = userpref.system
split = layout.split()
# 1. Column
column = split.column()
colsplit = column.split(percentage=0.85)
col = colsplit.column()
col.label(text="General:")
col.prop(system, "dpi")
col.label("Virtual Pixel Mode:")
col.prop(system, "virtual_pixel_mode", text="")
col.separator()
col.prop(system, "frame_server_port")
col.prop(system, "scrollback", text="Console Scrollback")
col.separator()
col.label(text="Sound:")
col.row().prop(system, "audio_device", expand=False)
sub = col.column()
sub.active = system.audio_device != 'NONE' and system.audio_device != 'Null'
#sub.prop(system, "use_preview_images")
sub.prop(system, "audio_channels", text="Channels")
sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
sub.prop(system, "audio_sample_rate", text="Sample Rate")
sub.prop(system, "audio_sample_format", text="Sample Format")
col.separator()
col.label(text="Screencast:")
col.prop(system, "screencast_fps")
col.prop(system, "screencast_wait_time")
col.separator()
if userpref.addons.find('cycles') != -1:
userpref.addons['cycles'].preferences.draw_impl(col, context)
if hasattr(system, "opensubdiv_compute_type"):
col.label(text="OpenSubdiv compute:")
col.row().prop(system, "opensubdiv_compute_type", text="")
# 2. Column
column = split.column()
colsplit = column.split(percentage=0.85)
col = colsplit.column()
col.label(text="OpenGL:")
col.prop(system, "gl_clip_alpha", slider=True)
col.prop(system, "use_mipmaps")
col.prop(system, "use_gpu_mipmap")
col.prop(system, "use_16bit_textures")
col.separator()
col.label(text="Selection")
col.prop(system, "select_method", text="")
col.separator()
col.label(text="Anisotropic Filtering")
col.prop(system, "anisotropic_filter", text="")
col.separator()
col.label(text="Window Draw Method:")
col.prop(system, "window_draw_method", text="")
col.prop(system, "multi_sample", text="")
if sys.platform == "linux" and system.multi_sample != 'NONE':
col.label(text="Might fail for Mesh editing selection!")
col.separator()
col.prop(system, "use_region_overlap")
col.separator()
col.label(text="Text Draw Options:")
col.prop(system, "use_text_antialiasing")
col.separator()
col.label(text="Textures:")
col.prop(system, "gl_texture_limit", text="Limit Size")
col.prop(system, "texture_time_out", text="Time Out")
col.prop(system, "texture_collection_rate", text="Collection Rate")
col.separator()
col.label(text="Images Draw Method:")
col.prop(system, "image_draw_method", text="")
col.separator()
col.label(text="Sequencer/Clip Editor:")
# currently disabled in the code
# col.prop(system, "prefetch_frames")
col.prop(system, "memory_cache_limit")
# 3. Column
column = split.column()
column.label(text="Solid OpenGL lights:")
split = column.split(percentage=0.1)
split.label()
split.label(text="Colors:")
split.label(text="Direction:")
lamp = system.solid_lights[0]
opengl_lamp_buttons(column, lamp)
lamp = system.solid_lights[1]
opengl_lamp_buttons(column, lamp)
lamp = system.solid_lights[2]
opengl_lamp_buttons(column, lamp)
column.separator()
column.label(text="Color Picker Type:")
column.row().prop(system, "color_picker_type", text="")
column.separator()
column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range")
sub = column.column()
sub.active = system.use_weight_color_range
sub.template_color_ramp(system, "weight_color_range", expand=True)
column.separator()
column.prop(system, "font_path_ui")
column.prop(system, "font_path_ui_mono")
if bpy.app.build_options.international:
column.prop(system, "use_international_fonts")
if system.use_international_fonts:
column.prop(system, "language")
row = column.row()
row.label(text="Translate:", text_ctxt=i18n_contexts.id_windowmanager)
row = column.row(align=True)
row.prop(system, "use_translate_interface", text="Interface", toggle=True)
row.prop(system, "use_translate_tooltips", text="Tooltips", toggle=True)
row.prop(system, "use_translate_new_dataname", text="New Data", toggle=True) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _theme_widget_style(layout, widget_style):
row = layout.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(widget_style, "outline")
colsub.row().prop(widget_style, "item", slider=True)
colsub.row().prop(widget_style, "inner", slider=True)
colsub.row().prop(widget_style, "inner_sel", slider=True)
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(widget_style, "text")
colsub.row().prop(widget_style, "text_sel")
colsub.prop(widget_style, "show_shaded")
subsub = colsub.column(align=True)
subsub.active = widget_style.show_shaded
subsub.prop(widget_style, "shadetop")
subsub.prop(widget_style, "shadedown")
layout.separator() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
theme = context.user_preferences.themes[0]
split_themes = layout.split(percentage=0.2)
sub = split_themes.column()
sub.label(text="Presets:")
subrow = sub.row(align=True)
subrow.menu("USERPREF_MT_interface_theme_presets", text=USERPREF_MT_interface_theme_presets.bl_label)
subrow.operator("wm.interface_theme_preset_add", text="", icon='ZOOMIN')
subrow.operator("wm.interface_theme_preset_add", text="", icon='ZOOMOUT').remove_active = True
sub.separator()
sub.prop(theme, "theme_area", expand=True)
split = layout.split(percentage=0.4)
layout.separator()
layout.separator()
split = split_themes.split()
if theme.theme_area == 'USER_INTERFACE':
col = split.column()
ui = theme.user_interface
col.label(text="Regular:")
self._theme_widget_style(col, ui.wcol_regular)
col.label(text="Tool:")
self._theme_widget_style(col, ui.wcol_tool)
col.label(text="Radio Buttons:")
self._theme_widget_style(col, ui.wcol_radio)
col.label(text="Text:")
self._theme_widget_style(col, ui.wcol_text)
col.label(text="Option:")
self._theme_widget_style(col, ui.wcol_option)
col.label(text="Toggle:")
self._theme_widget_style(col, ui.wcol_toggle)
col.label(text="Number Field:")
self._theme_widget_style(col, ui.wcol_num)
col.label(text="Value Slider:")
self._theme_widget_style(col, ui.wcol_numslider)
col.label(text="Box:")
self._theme_widget_style(col, ui.wcol_box)
col.label(text="Menu:")
self._theme_widget_style(col, ui.wcol_menu)
col.label(text="Pie Menu:")
self._theme_widget_style(col, ui.wcol_pie_menu)
col.label(text="Pulldown:")
self._theme_widget_style(col, ui.wcol_pulldown)
col.label(text="Menu Back:")
self._theme_widget_style(col, ui.wcol_menu_back)
col.label(text="Tooltip:")
self._theme_widget_style(col, ui.wcol_tooltip)
col.label(text="Menu Item:")
self._theme_widget_style(col, ui.wcol_menu_item)
col.label(text="Scroll Bar:")
self._theme_widget_style(col, ui.wcol_scroll)
col.label(text="Progress Bar:")
self._theme_widget_style(col, ui.wcol_progress)
col.label(text="List Item:")
self._theme_widget_style(col, ui.wcol_list_item)
ui_state = theme.user_interface.wcol_state
col.label(text="State:")
row = col.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui_state, "inner_anim")
colsub.row().prop(ui_state, "inner_anim_sel")
colsub.row().prop(ui_state, "inner_driven")
colsub.row().prop(ui_state, "inner_driven_sel")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui_state, "inner_key")
colsub.row().prop(ui_state, "inner_key_sel")
colsub.row().prop(ui_state, "blend")
col.separator()
col.separator()
col.label("Styles:")
row = col.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "menu_shadow_fac")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "menu_shadow_width")
row = col.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "icon_alpha")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "widget_emboss")
col.separator()
col.separator()
col.label("Axis Colors:")
row = col.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "axis_x")
colsub.row().prop(ui, "axis_y")
colsub.row().prop(ui, "axis_z")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
layout.separator()
layout.separator()
elif theme.theme_area == 'BONE_COLOR_SETS':
col = split.column()
for i, ui in enumerate(theme.bone_color_sets):
col.label(text=iface_("Color Set %d:") % (i + 1), translate=False) # i starts from 0
row = col.row()
subsplit = row.split(percentage=0.95)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "normal")
colsub.row().prop(ui, "select")
colsub.row().prop(ui, "active")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
colsub.row().prop(ui, "show_colored_constraints")
elif theme.theme_area == 'STYLE':
col = split.column()
style = context.user_preferences.ui_styles[0]
col.label(text="Panel Title:")
self._ui_font_style(col, style.panel_title)
col.separator()
col.label(text="Widget:")
self._ui_font_style(col, style.widget)
col.separator()
col.label(text="Widget Label:")
self._ui_font_style(col, style.widget_label)
else:
self._theme_generic(split, getattr(theme, theme.theme_area.lower()), theme.theme_area) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
userpref = context.user_preferences
paths = userpref.filepaths
system = userpref.system
split = layout.split(percentage=0.7)
col = split.column()
col.label(text="File Paths:")
colsplit = col.split(percentage=0.95)
col1 = colsplit.split(percentage=0.3)
sub = col1.column()
sub.label(text="Fonts:")
sub.label(text="Textures:")
sub.label(text="Render Output:")
sub.label(text="Scripts:")
sub.label(text="Sounds:")
sub.label(text="Temp:")
sub.label(text="Render Cache:")
sub.label(text="I18n Branches:")
sub.label(text="Image Editor:")
sub.label(text="Animation Player:")
sub = col1.column()
sub.prop(paths, "font_directory", text="")
sub.prop(paths, "texture_directory", text="")
sub.prop(paths, "render_output_directory", text="")
sub.prop(paths, "script_directory", text="")
sub.prop(paths, "sound_directory", text="")
sub.prop(paths, "temporary_directory", text="")
sub.prop(paths, "render_cache_directory", text="")
sub.prop(paths, "i18n_branches_directory", text="")
sub.prop(paths, "image_editor", text="")
subsplit = sub.split(percentage=0.3)
subsplit.prop(paths, "animation_player_preset", text="")
subsplit.prop(paths, "animation_player", text="")
col.separator()
col.separator()
colsplit = col.split(percentage=0.95)
sub = colsplit.column()
row = sub.split(percentage=0.3)
row.label(text="Auto Execution:")
row.prop(system, "use_scripts_auto_execute")
if system.use_scripts_auto_execute:
box = sub.box()
row = box.row()
row.label(text="Excluded Paths:")
row.operator("wm.userpref_autoexec_path_add", text="", icon='ZOOMIN', emboss=False)
for i, path_cmp in enumerate(userpref.autoexec_paths):
row = box.row()
row.prop(path_cmp, "path", text="")
row.prop(path_cmp, "use_glob", text="", icon='FILTER')
row.operator("wm.userpref_autoexec_path_remove", text="", icon='X', emboss=False).index = i
col = split.column()
col.label(text="Save & Load:")
col.prop(paths, "use_relative_paths")
col.prop(paths, "use_file_compression")
col.prop(paths, "use_load_ui")
col.prop(paths, "use_filter_files")
col.prop(paths, "show_hidden_files_datablocks")
col.prop(paths, "hide_recent_locations")
col.prop(paths, "hide_system_bookmarks")
col.prop(paths, "show_thumbnails")
col.separator()
col.prop(paths, "save_version")
col.prop(paths, "recent_files")
col.prop(paths, "use_save_preview_images")
col.separator()
col.label(text="Auto Save:")
col.prop(paths, "use_keep_session")
col.prop(paths, "use_auto_save_temporary_files")
sub = col.column()
sub.active = paths.use_auto_save_temporary_files
sub.prop(paths, "auto_save_time", text="Timer (mins)")
col.separator()
col.label(text="Text Editor:")
col.prop(system, "use_tabs_as_spaces")
colsplit = col.split(percentage=0.95)
col1 = colsplit.split(percentage=0.3)
sub = col1.column()
sub.label(text="Author:")
sub = col1.column()
sub.prop(system, "author", text="") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
input_prefs = context.user_preferences.inputs
is_view3d = context.space_data.type == 'VIEW_3D'
layout.prop(input_prefs, "ndof_sensitivity")
layout.prop(input_prefs, "ndof_orbit_sensitivity")
layout.prop(input_prefs, "ndof_deadzone")
if is_view3d:
layout.separator()
layout.prop(input_prefs, "ndof_show_guide")
layout.separator()
layout.label(text="Orbit style")
layout.row().prop(input_prefs, "ndof_view_navigate_method", text="")
layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
layout.separator()
layout.label(text="Orbit options")
layout.prop(input_prefs, "ndof_rotx_invert_axis")
layout.prop(input_prefs, "ndof_roty_invert_axis")
layout.prop(input_prefs, "ndof_rotz_invert_axis")
# view2d use pan/zoom
layout.separator()
layout.label(text="Pan options")
layout.prop(input_prefs, "ndof_panx_invert_axis")
layout.prop(input_prefs, "ndof_pany_invert_axis")
layout.prop(input_prefs, "ndof_panz_invert_axis")
layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
layout.label(text="Zoom options")
layout.prop(input_prefs, "ndof_zoom_invert")
if is_view3d:
layout.separator()
layout.label(text="Fly/Walk options")
layout.prop(input_prefs, "ndof_fly_helicopter", icon='NDOF_FLY')
layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM') |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
props = self.layout.operator("wm.context_set_value", text="Blender (default)")
props.data_path = "window_manager.keyconfigs.active"
props.value = "context.window_manager.keyconfigs.default"
# now draw the presets
Menu.draw_preset(self, context) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw_input_prefs(inputs, layout):
import sys
# General settings
row = layout.row()
col = row.column()
sub = col.column()
sub.label(text="Presets:")
subrow = sub.row(align=True)
subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label)
subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMIN')
subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMOUT').remove_active = True
sub.separator()
sub.label(text="Mouse:")
sub1 = sub.column()
sub1.active = (inputs.select_mouse == 'RIGHT')
sub1.prop(inputs, "use_mouse_emulate_3_button")
sub.prop(inputs, "use_mouse_continuous")
sub.prop(inputs, "drag_threshold")
sub.prop(inputs, "tweak_threshold")
sub.label(text="Select With:")
sub.row().prop(inputs, "select_mouse", expand=True)
sub = col.column()
sub.label(text="Double Click:")
sub.prop(inputs, "mouse_double_click_time", text="Speed")
sub.separator()
sub.prop(inputs, "use_emulate_numpad")
sub.separator()
sub.label(text="Orbit Style:")
sub.row().prop(inputs, "view_rotate_method", expand=True)
sub.separator()
sub.label(text="Zoom Style:")
sub.row().prop(inputs, "view_zoom_method", text="")
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
sub.row().prop(inputs, "view_zoom_axis", expand=True)
sub.prop(inputs, "invert_mouse_zoom", text="Invert Mouse Zoom Direction")
#sub.prop(inputs, "use_mouse_mmb_paste")
#col.separator()
sub = col.column()
sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
if sys.platform == "darwin":
sub = col.column()
sub.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
col.separator()
sub = col.column()
sub.label(text="View Navigation:")
sub.row().prop(inputs, "navigation_mode", expand=True)
if inputs.navigation_mode == 'WALK':
walk = inputs.walk_navigation
sub.prop(walk, "use_mouse_reverse")
sub.prop(walk, "mouse_speed")
sub.prop(walk, "teleport_time")
sub = col.column(align=True)
sub.prop(walk, "walk_speed")
sub.prop(walk, "walk_speed_factor")
sub.separator()
sub.prop(walk, "use_gravity")
sub = col.column(align=True)
sub.active = walk.use_gravity
sub.prop(walk, "view_height")
sub.prop(walk, "jump_height")
if inputs.use_ndof:
col.separator()
col.label(text="NDOF Device:")
sub = col.column(align=True)
sub.prop(inputs, "ndof_sensitivity", text="NDOF Sensitivity")
sub.prop(inputs, "ndof_orbit_sensitivity", text="NDOF Orbit Sensitivity")
sub.prop(inputs, "ndof_deadzone", text="NDOF Deadzone")
sub = col.column(align=True)
sub.row().prop(inputs, "ndof_view_navigate_method", expand=True)
sub.row().prop(inputs, "ndof_view_rotate_method", expand=True)
row.separator() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
from rna_keymap_ui import draw_keymaps
layout = self.layout
#import time
#start = time.time()
userpref = context.user_preferences
inputs = userpref.inputs
split = layout.split(percentage=0.25)
# Input settings
self.draw_input_prefs(inputs, split)
# Keymap Settings
draw_keymaps(context, split)
#print("runtime", time.time() - start) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
layout = self.layout
layout.operator(
"wm.url_open", text="Add-ons Catalog", icon='URL',
).url = "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts"
layout.separator()
layout.operator(
"wm.url_open", text="How to share your add-on", icon='URL',
).url = "http://wiki.blender.org/index.php/Dev:Py/Sharing"
layout.operator(
"wm.url_open", text="Add-on Guidelines", icon='URL',
).url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons"
layout.operator(
"wm.url_open", text="API Concepts", icon='URL',
).url = bpy.types.WM_OT_doc_view._prefix + "/info_quickstart.html"
layout.operator("wm.url_open", text="Add-on Tutorial", icon='URL',
).url = "http://www.blender.org/api/blender_python_api_current/info_tutorial_addon.html" |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def draw(self, context):
import os
import addon_utils
layout = self.layout
userpref = context.user_preferences
used_ext = {ext.module for ext in userpref.addons}
userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons")
scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
# collect the categories that can be filtered on
addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(refresh=False)]
split = layout.split(percentage=0.2)
col = split.column()
col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
col.label(text="Supported Level")
col.prop(context.window_manager, "addon_support", expand=True)
col.label(text="Categories")
col.prop(context.window_manager, "addon_filter", expand=True)
col = split.column()
# set in addon_utils.modules_refresh()
if addon_utils.error_duplicates:
self.draw_error(col,
"Multiple addons using the same name found!\n"
"likely a problem with the script search path.\n"
"(see console for details)",
)
if addon_utils.error_encoding:
self.draw_error(col,
"One or more addons do not have UTF-8 encoding\n"
"(see console for details)",
)
filter = context.window_manager.addon_filter
search = context.window_manager.addon_search.lower()
support = context.window_manager.addon_support
# initialized on demand
user_addon_paths = []
for mod, info in addons:
module_name = mod.__name__
is_enabled = module_name in used_ext
if info["support"] not in support:
continue
# check if addon should be visible with current filters
if ((filter == "All") or
(filter == info["category"]) or
(filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
):
if search and search not in info["name"].lower():
if info["author"]:
if search not in info["author"].lower():
continue
else:
continue
# Addon UI Code
col_box = col.column()
box = col_box.box()
colsub = box.column()
row = colsub.row(align=True)
row.operator(
"wm.addon_expand",
icon='TRIA_DOWN' if info["show_expanded"] else 'TRIA_RIGHT',
emboss=False,
).module = module_name
row.operator(
"wm.addon_disable" if is_enabled else "wm.addon_enable",
icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT', text="",
emboss=False,
).module = module_name
sub = row.row()
sub.active = is_enabled
sub.label(text='%s: %s' % (info["category"], info["name"]))
if info["warning"]:
sub.label(icon='ERROR')
# icon showing support level.
sub.label(icon=self._support_icon_mapping.get(info["support"], 'QUESTION'))
# Expanded UI (only if additional info is available)
if info["show_expanded"]:
if info["description"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Description:")
split.label(text=info["description"])
if info["location"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Location:")
split.label(text=info["location"])
if mod:
split = colsub.row().split(percentage=0.15)
split.label(text="File:")
split.label(text=mod.__file__, translate=False)
if info["author"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Author:")
split.label(text=info["author"], translate=False)
if info["version"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Version:")
split.label(text='.'.join(str(x) for x in info["version"]), translate=False)
if info["warning"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Warning:")
split.label(text=' ' + info["warning"], icon='ERROR')
user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths)
tot_row = bool(info["wiki_url"]) + bool(user_addon)
if tot_row:
split = colsub.row().split(percentage=0.15)
split.label(text="Internet:")
if info["wiki_url"]:
split.operator("wm.url_open", text="Documentation", icon='HELP').url = info["wiki_url"]
split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info.get(
"tracker_url",
"https://developer.blender.org/maniphest/task/edit/form/2")
if user_addon:
split.operator("wm.addon_remove", text="Remove", icon='CANCEL').module = mod.__name__
for i in range(4 - tot_row):
split.separator()
# Show addon user preferences
if is_enabled:
addon_preferences = userpref.addons[module_name].preferences
if addon_preferences is not None:
draw = getattr(addon_preferences, "draw", None)
if draw is not None:
addon_preferences_class = type(addon_preferences)
box_prefs = col_box.box()
box_prefs.label("Preferences:")
addon_preferences_class.layout = box_prefs
try:
draw(context)
except:
import traceback
traceback.print_exc()
box_prefs.label(text="Error (see console)", icon='ERROR')
del addon_preferences_class.layout
# Append missing scripts
# First collect scripts that are used but have no script file.
module_names = {mod.__name__ for mod, info in addons}
missing_modules = {ext for ext in used_ext if ext not in module_names}
if missing_modules and filter in {"All", "Enabled"}:
col.column().separator()
col.column().label(text="Missing script files")
module_names = {mod.__name__ for mod, info in addons}
for module_name in sorted(missing_modules):
is_enabled = module_name in used_ext
# Addon UI Code
box = col.column().box()
colsub = box.column()
row = colsub.row(align=True)
row.label(text="", icon='ERROR')
if is_enabled:
row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name
row.label(text=module_name, translate=False) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def refresh():
win.Refresh()
print type(win) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def EVT_LEFT_DOWN(event):
global _mpos
_mpos = event.Position |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def EVT_LEFT_UP(event):
global _mpos
_mpos = None |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def playcolors():
while 1:
global clearcolor
clearcolor = [np.random.random(),0,0,0]
time.sleep(0.1)
refresh() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def test_cnli(fake_qtile, patched_cnli, fake_window):
widget = patched_cnli.CapsNumLockIndicator()
fakebar = FakeBar([widget], window=fake_window)
widget._configure(fake_qtile, fakebar)
text = widget.poll()
assert text == "Caps off Num on" |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self):
self.factory = yui.YUI.widgetFactory()
self.dialog = self.factory.createPopupDialog()
mainvbox = self.factory.createVBox(self.dialog)
frame = self.factory.createFrame(mainvbox,"Test frame")
HBox = self.factory.createHBox(frame)
self.aboutbutton = self.factory.createPushButton(HBox,"&About")
self.closebutton = self.factory.createPushButton(self.factory.createRight(HBox), "&Close") |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def aboutDialog(self):
yui.YUI.widgetFactory;
mgafactory = yui.YMGAWidgetFactory.getYMGAWidgetFactory(yui.YExternalWidgets.externalWidgetFactory("mga"))
dlg = mgafactory.createAboutDialog("About dialog title example", "1.0.0", "GPLv3",
"Angelo Naselli", "This beautiful test example shows how it is easy to play with libyui bindings", "")
dlg.show(); |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def handleevent(self):
"""
Event-handler for the 'widgets' demo
"""
while True:
event = self.dialog.waitForEvent()
if event.eventType() == yui.YEvent.CancelEvent:
self.dialog.destroy()
break
if event.widget() == self.closebutton:
info = Info("Quit confirmation", 1, "Are you sure you want to quit?")
if self.ask_YesOrNo(info):
self.dialog.destroy()
break
if event.widget() == self.aboutbutton:
self.aboutDialog() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self):
# Fix some key bindings
self.bind("<Control-Key-a>", self.select_all)
# We will need Ctrl-/ for the "stroke", but it cannot be unbound, so
# let's prevent it from being passed to the standard handler
self.bind("<Control-Key-/>", lambda event: "break")
# Diacritical bindings
for a, k in self.accents:
# Little-known feature of Tk, it allows to bind an event to
# multiple keystrokes
self.bind("<Control-Key-%s><Key>" % k,
lambda event, a=a: self.insert_accented(event.char, a)) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def select_all(self, event=None):
self.selection_range(0, END)
return "break" |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self, master=None, **kwargs):
ScrolledText.__init__(self, master=None, **kwargs)
Diacritical.__init__(self) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def select_all(self, event=None):
self.tag_add(SEL, "1.0", "end-1c")
self.mark_set(INSERT, "1.0")
self.see(INSERT)
return "break" |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def test():
frame = Frame()
frame.pack(fill=BOTH, expand=YES)
if os.name == "nt":
# Set default font for all widgets; use Windows typical default
frame.option_add("*font", "Tahoma 8")
# The editors
entry = DiacriticalEntry(frame)
entry.pack(fill=BOTH, expand=YES)
text = DiacriticalText(frame, width=76, height=25, wrap=WORD)
if os.name == "nt":
# But this looks better than the default set above
text.config(font="Arial 10")
text.pack(fill=BOTH, expand=YES)
text.focus()
frame.master.title("Diacritical Editor")
frame.mainloop() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self, parent, window):
self._parent = parent
self._window = window
self._application = self._parent._application
# create user interface
self._container = gtk.VBox(False, 5)
self._controls = gtk.HBox(False, 5)
separator = gtk.HSeparator()
# pack interface
self._container.pack_end(separator, False, False, 0)
self._container.pack_end(self._controls, False, False, 0) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def main(self):
UI.OpenDialog(
VBox(
Heading("This Is a Heading."),
Label("This is a Label."),
PushButton("&OK")
)
)
UI.UserInput()
UI.CloseDialog() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self, backendsdialog):
"""
Constructor, just initializes the gtk widgets
@param backends: a reference to the dialog in which this is
loaded
"""
super().__init__()
self.dialog = backendsdialog
self.req = backendsdialog.get_requester()
self._init_liststore()
self._init_renderers()
self._init_signals()
self.refresh() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def on_backend_state_changed(self, sender, backend_id):
"""
Signal callback executed when a backend is enabled/disabled.
@param sender: not used, only here to let this function be used as a
callback
@param backend_id: the id of the backend to add
"""
if backend_id in self.backendid_to_iter:
b_iter = self.backendid_to_iter[backend_id]
b_path = self.liststore.get_path(b_iter)
backend = self.req.get_backend(backend_id)
backend_name = backend.get_human_name()
if backend.is_enabled():
text = backend_name
else:
# FIXME This snippet is on more than 2 places!!!
# FIXME create a function which takes a widget and
# flag and returns color as #RRGGBB
style_context = self.get_style_context()
color = style_context.get_color(Gtk.StateFlags.INSENSITIVE)
color = rgba_to_hex(color)
text = f"<span color='{color}'>{backend_name}</span>"
self.liststore[b_path][self.COLUMN_TEXT] = text
# Also refresh the tags
new_tags = self._get_markup_for_tags(backend.get_attached_tags())
self.liststore[b_path][self.COLUMN_TAGS] = new_tags |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _init_renderers(self):
"""Initializes the cell renderers"""
# We hide the columns headers
self.set_headers_visible(False)
# For the backend icon
pixbuf_cell = Gtk.CellRendererPixbuf()
tvcolumn_pixbuf = Gtk.TreeViewColumn('Icon', pixbuf_cell)
tvcolumn_pixbuf.add_attribute(pixbuf_cell, 'pixbuf', self.COLUMN_ICON)
self.append_column(tvcolumn_pixbuf)
# For the backend name
text_cell = Gtk.CellRendererText()
tvcolumn_text = Gtk.TreeViewColumn('Name', text_cell)
tvcolumn_text.add_attribute(text_cell, 'markup', self.COLUMN_TEXT)
self.append_column(tvcolumn_text)
text_cell.connect('edited', self.cell_edited_callback)
text_cell.set_property('editable', True)
# For the backend tags
tags_cell = Gtk.CellRendererText()
tvcolumn_tags = Gtk.TreeViewColumn('Tags', tags_cell)
tvcolumn_tags.add_attribute(tags_cell, 'markup', self.COLUMN_TAGS)
self.append_column(tvcolumn_tags) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def cell_edited_callback(self, text_cell, path, new_text):
"""If a backend name is changed, it saves the changes in the Backend
@param text_cell: not used. The Gtk.CellRendererText that emitted the
signal. Only here because it's passed by the signal
@param path: the Gtk.TreePath of the edited cell
@param new_text: the new name of the backend
"""
# we strip everything not permitted in backend names
new_text = ''.join(c for c in new_text if (c.isalnum() or c in [" ", "-", "_"]))
selected_iter = self.liststore.get_iter(path)
# update the backend name
backend_id = self.liststore.get_value(selected_iter,
self.COLUMN_BACKEND_ID)
backend = self.dialog.get_requester().get_backend(backend_id)
if backend:
backend.set_human_name(new_text)
# update the text in the liststore
self.liststore.set(selected_iter, self.COLUMN_TEXT, new_text) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _init_signals(self):
"""Initializes the backends and gtk signals """
self.connect("cursor-changed", self.on_select_row)
_signals = BackendSignals()
_signals.connect(_signals.BACKEND_ADDED, self.on_backend_added)
_signals.connect(_signals.BACKEND_STATE_TOGGLED,
self.on_backend_state_changed) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def on_select_row(self, treeview=None):
"""When a row is selected, displays the corresponding editing panel
@var treeview: not used
"""
self.dialog.on_backend_selected(self.get_selected_backend_id()) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def select_backend(self, backend_id=None):
"""
Selects the backend corresponding to backend_id.
If backend_id is none, refreshes the current configuration panel.
@param backend_id: the id of the backend to select
"""
selection = self.get_selection()
if backend_id in self.backendid_to_iter:
backend_iter = self.backendid_to_iter[backend_id]
if selection:
selection.select_iter(backend_iter)
else:
if self._get_selected_path():
# We just reselect the currently selected entry
self.on_select_row()
else:
# If nothing is selected, we select the first entry
if selection:
selection.select_path("0")
self.dialog.on_backend_selected(self.get_selected_backend_id()) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def add_item(self, item):
self._vbox_items.pack_start(item.widget, expand=False, fill=False) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _setup_drag(self, item):
self._drag_and_drop_context.setup_drag(
item.item_widget,
self._get_drag_data,
self._on_drag_data_received,
[item],
[item],
self) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _on_item_widget_key_press_event(self, widget, event, item):
if event.state & gtk.gdk.MOD1_MASK: # Alt key
key_name = gtk.gdk.keyval_name(event.keyval)
if key_name in ["Up", "KP_Up"]:
self.reorder_item(
item, self._get_item_position(item) - 1)
elif key_name in ["Down", "KP_Down"]:
self.reorder_item(
item, self._get_item_position(item) + 1) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def widget(self):
return self._event_box |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def remove_item_widget(self):
self._hbox.remove(self._item_widget) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _setup_item_button(self, item_button, icon, position=None):
item_button.set_relief(gtk.RELIEF_NONE) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _on_event_box_enter_notify_event(self, event_box, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
self._hbox_buttons.show() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _on_event_box_leave_notify_event(self, event_box, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
self._hbox_buttons.hide() |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _on_event_box_size_allocate(self, event_box, allocation):
if self._is_event_box_allocated_size:
return |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _on_event_box_buttons_size_allocate(self, event_box, allocation):
if self._buttons_allocation is not None:
return |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _init_gui(self):
self._size_spin_button = gtk.SpinButton(
gtk.Adjustment(
value=0,
lower=self._min_size,
upper=self._max_size,
step_incr=1,
page_incr=10,
),
digits=0) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def _setup_drag(self, item):
self._drag_and_drop_context.setup_drag(
# Using the entire item allows dragging only by the label rather than the
# widget itself. This avoids problems with widgets such as spin buttons
# that do not behave correctly when reordering and also avoids accidental
# clicking and modifying the widget by the user.
item.widget,
self._get_drag_data,
self._on_drag_data_received,
[item],
[item],
self) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def activate (self, pluggable):
self.rg = self.pluggable = pluggable
self.add_to_uimanager(pluggable.ui_manager) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def set_theme(self, themefile):
""" Send the given theme settings to the controller. This should result
in the lights changing to the theme settings immediately.
"""
try:
self._driver.acquire()
cmds_boot = []
pkt = self.cmd_packet |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def disableEvents(self):
self._click_area.setAcceptHoverEvents(False)
self.mouseMoveEvent = QGraphicsPathItem.mouseMoveEvent
self.mousePressEvent = QGraphicsPathItem.mousePressEvent |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def showMod(self, mod_id: str, color: str):
self._mod_item = QGraphicsEllipseItem(MOD_RECT, self)
self.changeMod(mod_id, color)
self._mod_item.show()
# print("Showing {}".format(mod_id)) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def changeMod(self, mod_id: str, color: str):
self._mod_id = mod_id
self._mod_item.setBrush(QBrush(getColorObj(color))) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def mousePressEvent(self, event: QGraphicsSceneMouseEvent):
"""Parses a :meth:`mousePressEvent`, calling the appropriate tool
method as necessary. Stores ``_move_idx`` for future comparison.
"""
self.scene().views()[0].addToPressList(self)
idx = self._strand_item.setActiveEndpoint(self.cap_type)
self._move_idx = idx
active_tool_str = self._getActiveTool().methodPrefix()
tool_method_name = active_tool_str + "MousePress"
if hasattr(self, tool_method_name): # if the tool method exists
modifiers = event.modifiers()
getattr(self, tool_method_name)(modifiers, event, self.idx()) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def hoverLeaveEvent(self, event: QGraphicsSceneHoverEvent):
self._strand_item.hoverLeaveEvent(event) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def mouseMoveEvent(self, event: QGraphicsSceneMouseEvent):
"""Parses a :meth:`mouseMoveEvent`, calling the appropriate tool
method as necessary. Updates ``_move_idx`` if it changed.
"""
tool_method_name = self._getActiveTool().methodPrefix() + "MouseMove"
if hasattr(self, tool_method_name): # if the tool method exists
idx = int(floor((self.x() + event.pos().x()) / _BASE_WIDTH))
if idx != self._move_idx: # did we actually move?
modifiers = event.modifiers()
self._move_idx = idx
getattr(self, tool_method_name)(modifiers, idx) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def customMouseRelease(self, event: QMouseEvent):
"""Parses a :meth:`mouseReleaseEvent` from view, calling the appropriate
tool method as necessary. Deletes ``_move_idx`` if necessary.
"""
tool_method_name = self._getActiveTool().methodPrefix() + "MouseRelease"
if hasattr(self, tool_method_name): # if the tool method exists
modifiers = event.modifiers()
x = event.pos().x()
getattr(self, tool_method_name)(modifiers, x) # call tool method
if hasattr(self, '_move_idx'):
del self._move_idx |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def modsToolMousePress(self, modifiers: Qt.KeyboardModifiers,
event: QGraphicsSceneMouseEvent,
idx: int):
"""
Checks that a scaffold was clicked, and then calls apply sequence
to the clicked strand via its oligo.
"""
m_strand = self._strand_item._model_strand
self._getActiveTool().applyMod(m_strand, idx) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def createToolMousePress(self, modifiers: Qt.KeyboardModifiers,
event: QGraphicsSceneMouseEvent,
idx: int):
"""Break the strand is possible."""
m_strand = self._strand_item._model_strand
vhi = self._strand_item._virtual_helix_item
active_tool = self._getActiveTool()
if active_tool.isFloatingXoverBegin():
if m_strand.idx5Prime() == idx:
return
else:
temp_xover = active_tool.floatingXover()
temp_xover.updateBase(vhi, m_strand, idx)
active_tool.setFloatingXoverBegin(False)
else:
active_tool.setFloatingXoverBegin(True)
# install Xover
active_tool.attemptToCreateXover(vhi, m_strand, idx) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def selectToolMouseRelease(self, modifiers: Qt.KeyboardModifiers, x):
"""
If the positional-calculated idx differs from the model idx, it means
we have moved and should notify the model to resize.
If the mouse event had a key modifier, perform special actions:
shift = attempt to merge with a neighbor
alt = extend to max drag bound
"""
m_strand = self._strand_item._model_strand
if modifiers & Qt.ShiftModifier:
self.setSelected(False)
self.restoreParent()
m_strand.merge(self.idx()) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def restoreParent(self, pos: QPointF = None):
"""
Required to restore parenting and positioning in the partItem
"""
# map the position
self.tempReparent(pos=pos)
self.setSelectedColor(False)
self.setSelected(False) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def tempReparent(self, pos: QPointF = None):
vh_item = self._strand_item.virtualHelixItem()
if pos is None:
pos = self.scenePos()
self.setParentItem(vh_item)
temp_point = vh_item.mapFromScene(pos)
self.setPos(temp_point) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def updateHighlight(self, brush: QBrush):
if not self.isSelected():
self.setBrush(brush) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def paint(self, painter: QPainter,
option: QStyleOptionGraphicsItem,
widget: QWidget):
painter.setPen(self.pen())
painter.setBrush(self.brush())
painter.drawPath(self.path()) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def setUp(self):
'''
reset GUI
'''
for k, v in self.main_control_defaults.items():
getattr(self.pile_viewer, k).set_value(v)
self.initial_trange = self.viewer.get_time_range()
self.viewer.set_tracks_range(
[0, self.viewer.ntracks_shown_max])
self.tempfiles = [] |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
region = dict(required=True,
aliases = ['aws_region', 'ec2_region']),
owner = dict(required=False, default=None),
ami_id = dict(required=False),
ami_tags = dict(required=False, type='dict',
aliases = ['search_tags', 'image_tags']),
architecture = dict(required=False),
hypervisor = dict(required=False),
is_public = dict(required=False),
name = dict(required=False),
platform = dict(required=False),
sort = dict(required=False, default=None,
choices=['name', 'description', 'tag']),
sort_tag = dict(required=False),
sort_order = dict(required=False, default='ascending',
choices=['ascending', 'descending']),
sort_start = dict(required=False),
sort_end = dict(required=False),
state = dict(required=False, default='available'),
virtualization_type = dict(required=False),
no_result_action = dict(required=False, default='success',
choices = ['success', 'fail']),
)
)
module = AnsibleModule(
argument_spec=argument_spec,
)
if not HAS_BOTO:
module.fail_json(msg='boto required for this module, install via pip or your package manager')
ami_id = module.params.get('ami_id')
ami_tags = module.params.get('ami_tags')
architecture = module.params.get('architecture')
hypervisor = module.params.get('hypervisor')
is_public = module.params.get('is_public')
name = module.params.get('name')
owner = module.params.get('owner')
platform = module.params.get('platform')
sort = module.params.get('sort')
sort_tag = module.params.get('sort_tag')
sort_order = module.params.get('sort_order')
sort_start = module.params.get('sort_start')
sort_end = module.params.get('sort_end')
state = module.params.get('state')
virtualization_type = module.params.get('virtualization_type')
no_result_action = module.params.get('no_result_action')
filter = {'state': state}
if ami_id:
filter['image_id'] = ami_id
if ami_tags:
for tag in ami_tags:
filter['tag:'+tag] = ami_tags[tag]
if architecture:
filter['architecture'] = architecture
if hypervisor:
filter['hypervisor'] = hypervisor
if is_public:
filter['is_public'] = is_public
if name:
filter['name'] = name
if platform:
filter['platform'] = platform
if virtualization_type:
filter['virtualization_type'] = virtualization_type
ec2 = ec2_connect(module)
images_result = ec2.get_all_images(owners=owner, filters=filter)
if no_result_action == 'fail' and len(images_result) == 0:
module.fail_json(msg="No AMIs matched the attributes: %s" % json.dumps(filter))
results = []
for image in images_result:
data = {
'ami_id': image.id,
'architecture': image.architecture,
'description': image.description,
'is_public': image.is_public,
'name': image.name,
'owner_id': image.owner_id,
'platform': image.platform,
'root_device_name': image.root_device_name,
'root_device_type': image.root_device_type,
'state': image.state,
'tags': image.tags,
'virtualization_type': image.virtualization_type,
}
if image.kernel_id:
data['kernel_id'] = image.kernel_id
if image.ramdisk_id:
data['ramdisk_id'] = image.ramdisk_id
results.append(data)
if sort == 'tag':
if not sort_tag:
module.fail_json(msg="'sort_tag' option must be given with 'sort=tag'")
results.sort(key=lambda e: e['tags'][sort_tag], reverse=(sort_order=='descending'))
elif sort:
results.sort(key=lambda e: e[sort], reverse=(sort_order=='descending'))
try:
if sort and sort_start and sort_end:
results = results[int(sort_start):int(sort_end)]
elif sort and sort_start:
results = results[int(sort_start):]
elif sort and sort_end:
results = results[:int(sort_end)]
except TypeError:
module.fail_json(msg="Please supply numeric values for sort_start and/or sort_end")
module.exit_json(results=results) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def __init__(self):
ApiCli.__init__(self)
self.path = "v1/account/sources/"
self.method = "GET" |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def test_get_volume_attachment(self):
"""Test getting volume attachments
Attach a volume to a server, and then retrieve volume's attachments
info.
"""
# Create a server
server = self.create_server()
# Verify that a volume's attachment information is retrieved
self.volumes_client.attach_volume(self.volume['id'],
instance_uuid=server['id'],
mountpoint='/dev/%s' %
CONF.compute.volume_device_name)
waiters.wait_for_volume_resource_status(self.volumes_client,
self.volume['id'],
'in-use')
self.addCleanup(waiters.wait_for_volume_resource_status,
self.volumes_client,
self.volume['id'], 'available')
self.addCleanup(self.volumes_client.detach_volume, self.volume['id'])
volume = self.volumes_client.show_volume(self.volume['id'])['volume']
attachment = volume['attachments'][0]
self.assertEqual('/dev/%s' %
CONF.compute.volume_device_name,
attachment['device'])
self.assertEqual(server['id'], attachment['server_id'])
self.assertEqual(self.volume['id'], attachment['id'])
self.assertEqual(self.volume['id'], attachment['volume_id']) |
def __init__(self):
self.filediff = None
meldsettings.connect('changed', self.on_setting_changed) | def list_snapshots(self, params=None):
"""List all the snapshot."""
url = 'snapshots'
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
body = json.loads(body)
return resp, body['snapshots'] |