diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-09 05:37:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-09 05:37:09 +0400 |
commit | a6f13f9d7bfef7020d43cb0a8058753e6d7a128d (patch) | |
tree | 09535f0341f93288fc492c3318ba2213291345d9 /release/scripts/ui/space_sequencer.py | |
parent | 7fcbbad5a45acf5b4ef49d16cf6733afd1e481c7 (diff) |
poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'.
de-duplicated poll functions and made some minor tweaks too.
Diffstat (limited to 'release/scripts/ui/space_sequencer.py')
-rw-r--r-- | release/scripts/ui/space_sequencer.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index df373526584..3a828bfb6d0 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -320,9 +320,9 @@ class SequencerButtonsPanel(): def has_sequencer(context): return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') - @staticmethod - def poll(context): - return __class__.has_sequencer(context) and (act_strip(context) is not None) + @classmethod + def poll(cls, context): + return cls.has_sequencer(context) and (act_strip(context) is not None) class SequencerButtonsPanel_Output(): @@ -333,9 +333,9 @@ class SequencerButtonsPanel_Output(): def has_preview(context): return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') - @staticmethod - def poll(context): - return __class__.has_preview(context) + @classmethod + def poll(cls, context): + return cls.has_preview(context) class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): @@ -388,9 +388,9 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Effect Strip" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -518,9 +518,9 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Strip Input" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -593,9 +593,9 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Sound" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -634,9 +634,9 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Scene" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -659,9 +659,9 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Filter" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) @@ -721,9 +721,9 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): class SEQUENCER_PT_proxy(SequencerButtonsPanel, bpy.types.Panel): bl_label = "Proxy" - @staticmethod - def poll(context): - if not __class__.has_sequencer(context): + @classmethod + def poll(cls, context): + if not cls.has_sequencer(context): return False strip = act_strip(context) |