CSSED python scripting

Developer's Guide


Table of Contents
1. Introduction
2. Environment setup
3. Coding basics
3.1. Interpreter scope (important)
3.2. Interpreter Reference count - How to hold a interpreter instance.
3.3. Sharing data between various scripts
3.4. PyGtk 2.0
4. Debugging
5. Cssed python API
5.1. Methods (grouped)
5.1.1. Text retrieval and modification
5.1.2. Selection
5.1.3. Information
5.1.4. Line and position
5.1.5. Autocompletion
5.1.6. Call tips
5.1.7. Markers and bookmarks
5.1.8. Undo redo cut copy and paste
5.1.9. Folding
5.1.10. Documents and files
5.1.11. Output to cssed
5.1.12. Zooming
5.1.13. File selector
5.1.14. Interpreter
5.2. Methods (alphabetic)
5.2.1. add_text()
5.2.2. autocompletion_cancel()
5.2.3. autocompletion_select()
5.2.4. bookmark_next()
5.2.5. bookmark_prev()
5.2.6. calltip_get_pos_start()
5.2.7. can_redo()
5.2.8. can_undo()
5.2.9. cancel_calltip()
5.2.10. clear_arrow_marker()
5.2.11. clear_sel()
5.2.12. copy()
5.2.13. cut()
5.2.14. document_grab_focus()
5.2.15. ensure_line_is_visible()
5.2.16. error_message()
5.2.17. fold_all()
5.2.18. get_current_line()
5.2.19. get_current_position()
5.2.20. get_document_index()
5.2.21. get_filename()
5.2.22. get_fold_depth()
5.2.23. get_fold_level()
5.2.24. get_folding_enabled()
5.2.25. get_folding_margin_visible()
5.2.26. get_global_python_directory()
5.2.27. get_length()
5.2.28. get_line_count()
5.2.29. get_line_end_from_position()
5.2.30. get_line_from_position()
5.2.31. get_line_is_visible()
5.2.32. get_line_length()
5.2.33. get_modified()
5.2.34. get_num_docs()
5.2.35. get_position_from_line()
5.2.36. get_selected_text()
5.2.37. get_selection_end()
5.2.38. get_selection_start()
5.2.39. get_style_at()
5.2.40. get_text()
5.2.41. get_text_line()
5.2.42. get_user_python_directory()
5.2.43. interpreter_decref()
5.2.44. interpreter_init_script()
5.2.45. interpreter_ref()
5.2.46. interpreter_refcount()
5.2.47. is_autocompletion_active()
5.2.48. is_bookmark_set_at_line()
5.2.49. is_calltip_active()
5.2.50. is_file_opened()
5.2.51. is_folding_enabled()
5.2.52. is_marker_set_at_line()
5.2.53. marker_next()
5.2.54. marker_prev()
5.2.55. new_document()
5.2.56. open_file()
5.2.57. output_clear()
5.2.58. output_write()
5.2.59. paste()
5.2.60. prompt_for_directory_to_create()
5.2.61. prompt_for_directory_to_open()
5.2.62. prompt_for_file_to_open()
5.2.63. prompt_for_file_to_save()
5.2.64. redo()
5.2.65. replace_sel()
5.2.66. save_document()
5.2.67. save_document_as()
5.2.68. search_next()
5.2.69. search_prev()
5.2.70. select_text_range()
5.2.71. set_arrow_marker_at_line()
5.2.72. set_bookmark_at_line()
5.2.73. set_current_line()
5.2.74. set_current_position()
5.2.75. set_document_by_index()
5.2.76. set_folding_margin_visible()
5.2.77. set_marker_at_line()
5.2.78. set_selection_end()
5.2.79. set_selection_range()
5.2.80. set_selection_start()
5.2.81. show_autocompletion_list()
5.2.82. show_calltip()
5.2.83. show_user_list()
5.2.84. toggle_fold_at_line()
5.2.85. undo()
5.2.86. unfold_all()
5.2.87. zoom_in()
5.2.88. zoom_off()
5.2.89. zoom_out()
5.3. Undocumented functions
6. Document Information
Developer's Guide

1. Introduction

Cssed's python scripting, is allowed through plugins, and it's aimed to provide python bindings for cssed's pluggable interface.

It may be useful for cssed users who needs to automate some tasks, or needs to add missing functionalities to cssed.

The cssed's python plugins does not extends or adds any functionality to python. You cannot run a cssed python script out of cssed's embedded interpreter.

Those bindings have not been made with full python programming into cssed in mind, but to provide an easy way to make some simple repetitive tasks easier to accomplish.

If you want to use PyGtk on cssed scripts, please check the sections "Interpreter Reference count" for further information on how to do it.

To use python scripts onto cssed, you'll need the cssed's python plugin loaded.