~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/startup/bl_ui/space_console.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    bl_space_type = 'CONSOLE'
26
26
 
27
27
    def draw(self, context):
28
 
        layout = self.layout.row(align=True)
 
28
        layout = self.layout.row()
29
29
 
30
30
        layout.template_header()
31
31
 
41
41
    def draw(self, context):
42
42
        layout = self.layout
43
43
 
 
44
        layout.operator("console.indent")
 
45
        layout.operator("console.unindent")
 
46
 
 
47
        layout.separator()
 
48
 
44
49
        layout.operator("console.clear")
 
50
        layout.operator("console.clear_line")
 
51
 
 
52
        layout.separator()
 
53
 
 
54
        layout.operator("console.copy_as_script")
45
55
        layout.operator("console.copy")
46
56
        layout.operator("console.paste")
47
57
        layout.menu("CONSOLE_MT_language")
65
75
        languages = []
66
76
        for modname, mod in sys.modules.items():
67
77
            if modname.startswith("console_") and hasattr(mod, "execute"):
68
 
                languages.append(modname.split('_', 1)[-1])
 
78
                languages.append(modname.split("_", 1)[-1])
69
79
 
70
80
        languages.sort()
71
81
 
72
82
        for language in languages:
73
 
            layout.operator("console.language", text=language[0].upper() + language[1:]).language = language
 
83
            layout.operator("console.language",
 
84
                            text=language.title(),
 
85
                            translate=False).language = language
74
86
 
75
87
 
76
88
def add_scrollback(text, text_type):
77
 
    for l in text.split('\n'):
 
89
    for l in text.split("\n"):
78
90
        bpy.ops.console.scrollback_append(text=l.replace('\t', '    '),
79
 
            type=text_type)
 
91
                                          type=text_type)
80
92
 
81
93
if __name__ == "__main__":  # only for live edit.
82
94
    bpy.utils.register_module(__name__)