[904] | 1 | .. $Id: hints.rst 907 2012-06-11 22:53:33Z jemian $ |
---|
| 2 | |
---|
| 3 | Hints while developing the extension |
---|
| 4 | =================================================================== |
---|
| 5 | |
---|
| 6 | Useful reading |
---|
| 7 | --------------- |
---|
| 8 | |
---|
| 9 | * http://sphinx.pocoo.org/domains.html |
---|
| 10 | * http://sphinx.pocoo.org/ext/appapi.html#domain-api |
---|
| 11 | * http://sphinx.pocoo.org/ext/tutorial.html |
---|
| 12 | * https://bitbucket.org/birkenfeld/sphinx-contrib/ |
---|
[905] | 13 | * http://sphinx.pocoo.org/ext/appapi.html#sphinx.domains.Domain |
---|
[904] | 14 | |
---|
[905] | 15 | .. note:: Per ``src/refs/sphinx-contrib/README``, |
---|
| 16 | *Use "make-ext.py" to set up your extension subdirectory.* |
---|
| 17 | |
---|
| 18 | There is also a useful comment about using ``ez_setup.py``. |
---|
[904] | 19 | |
---|
[905] | 20 | |
---|
[904] | 21 | Regular Expression Parts to Recognize ... |
---|
| 22 | -------------------------------------------- |
---|
| 23 | |
---|
| 24 | the start of a macro definition (``def`` or ``rdef``) |
---|
| 25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
| 26 | |
---|
| 27 | ==================== =============================== |
---|
| 28 | regexp description |
---|
| 29 | ==================== =============================== |
---|
| 30 | ``^`` start of line |
---|
| 31 | ``[\s]*`` optional preceding white space |
---|
| 32 | ``[r]?`` rdef? |
---|
| 33 | ``def`` "def" declaration |
---|
| 34 | ``[\s]+`` required trailing space |
---|
| 35 | ``([a-zA-Z_][\w]*)`` macro name |
---|
| 36 | ==================== =============================== |
---|
| 37 | |
---|
| 38 | the start of a chained macro definition (``cdef``) |
---|
| 39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
| 40 | |
---|
| 41 | ========= ================================ |
---|
| 42 | regexp description |
---|
| 43 | ========= ================================ |
---|
| 44 | ``^`` start of line |
---|
| 45 | ``[\s]*`` optional preceding white space |
---|
| 46 | ``cdef`` "cdef" declaration |
---|
| 47 | ``[\s]+`` required trailing space |
---|
| 48 | ``\(`` start of argument list |
---|
| 49 | ========= ================================ |
---|
| 50 | |
---|
| 51 | a global variable declaration |
---|
| 52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
| 53 | |
---|
| 54 | ======================================= ================================= |
---|
| 55 | regexp description |
---|
| 56 | ======================================= ================================= |
---|
| 57 | ``^`` start of line |
---|
| 58 | ``([\s]*)`` optional preceding white space |
---|
| 59 | ``global`` "global" declaration |
---|
| 60 | ``([\s]+[@]?[a-zA-Z_][\w]*(\[\])?)+`` one or more variable names |
---|
| 61 | ``([\s]+#.*)*`` optional comment |
---|
| 62 | ``$`` end of line |
---|
| 63 | ======================================= ================================= |
---|
| 64 | |
---|
| 65 | test cases |
---|
| 66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
| 67 | |
---|
| 68 | :: |
---|
| 69 | |
---|
| 70 | global BCDA_GM[] |
---|
| 71 | |
---|
| 72 | global billy[] |
---|
| 73 | global 9billy[] |
---|
| 74 | global _billy[] |
---|
| 75 | |
---|
| 76 | global kohzu_PV kohzuMV_PV UND_PV Und_Off UNDE_TRACK_ON |
---|
| 77 | global kohzuStop_PV kohzuMode_PV kohzuMove_PV |
---|
| 78 | global CCD_PREFIX # EPICS PV for CCD server |
---|
| 79 | global CCD_OVERHEAD_SECS # readout time |
---|
| 80 | global CCD_OVERHEAD_SECS_MEASURED # measured readout time |
---|
| 81 | |
---|
| 82 | global @A_name[] @B_name[] |
---|
| 83 | unglobal @A_name |
---|
| 84 | unglobal @B_name |
---|
| 85 | global CCD_DARK_NUM CCDDARK CCD_THROW |
---|
| 86 | global MULTI_IMGS # useful 8-ID's imm fileformat; currently not used |
---|
| 87 | |
---|
| 88 | def _ascan '' |
---|
| 89 | |
---|
| 90 | kohzuMove_PV = "32ida:KohzuPutBO" |
---|
| 91 | Und_Delay = 0.1 |
---|
| 92 | |
---|
| 93 | def kohzuE_cmd(mne,key,p1) '{ |
---|
| 94 | if (key == "set_position") { |
---|
| 95 | return |
---|
| 96 | } |
---|
| 97 | }' |
---|
| 98 | |
---|
| 99 | def show_und' |
---|
| 100 | printf("\n%40.40s","Curent Undulator Status") |
---|
| 101 | ' |
---|
| 102 | |
---|
| 103 | # cleanup macro for ^C usage |
---|
| 104 | rdef _cleanup3 \'resetUSAXS\' |
---|
| 105 | rdef _cleanup3 \'\' |
---|
| 106 | cdef("Fheader", fheader, "UCOL", 0x20) |
---|
| 107 | rdef Flabel \'""\' |
---|