Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/userpref.py
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| f_full = os.path.join(path_base, f) | f_full = os.path.join(path_base, f) | ||||
| if os.path.isdir(f_full): | if os.path.isdir(f_full): | ||||
| shutil.rmtree(f_full) | shutil.rmtree(f_full) | ||||
| else: | else: | ||||
| os.remove(f_full) | os.remove(f_full) | ||||
| class PREFERENCES_OT_keyconfig_activate(Operator): | class PREFERENCES_OT_keyconfig_activate(Operator): | ||||
| """Activate key configuration""" | |||||
| bl_idname = "preferences.keyconfig_activate" | bl_idname = "preferences.keyconfig_activate" | ||||
| bl_label = "Activate Keyconfig" | bl_label = "Activate Keyconfig" | ||||
| filepath: StringProperty( | filepath: StringProperty( | ||||
| subtype='FILE_PATH', | subtype='FILE_PATH', | ||||
| ) | ) | ||||
| def execute(self, _context): | def execute(self, _context): | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| overwrite: BoolProperty( | overwrite: BoolProperty( | ||||
| name="Overwrite", | name="Overwrite", | ||||
| description="Remove existing add-ons with the same ID", | description="Remove existing add-ons with the same ID", | ||||
| default=True, | default=True, | ||||
| ) | ) | ||||
| target: EnumProperty( | target: EnumProperty( | ||||
| name="Target Path", | name="Target Path", | ||||
| items=( | items=( | ||||
| ('DEFAULT', "Default", ""), | ('DEFAULT', "Default", "Default add-ons directory"), | ||||
| ('PREFS', "Preferences", ""), | ('PREFS', "Preferences", "Directory defined in the user preferences"), | ||||
| ), | ), | ||||
| ) | ) | ||||
| filepath: StringProperty( | filepath: StringProperty( | ||||
| subtype='FILE_PATH', | subtype='FILE_PATH', | ||||
| ) | ) | ||||
| filter_folder: BoolProperty( | filter_folder: BoolProperty( | ||||
| name="Filter folders", | name="Filter folders", | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||