|
1 | 1 | # -*- coding: utf-8 -*- |
| 2 | +# FROM https://raw.githubusercontent.com/bruderstein/PythonScript/master/scripts/Samples/ |
2 | 3 |
|
3 | 4 | import re |
4 | 5 |
|
|
54 | 55 | # - Modify the NAME of the file, containing the SEARCH and REPLACEMENT regexes |
55 | 56 | # - Indicate an ABSOLUTE or RELATIVE path, before the filename |
56 | 57 |
|
57 | | -with open(r'SR_list.txt') as f: sr_list = f.readlines() |
| 58 | +#with open(r'SR_list.txt') as f: sr_list = f.readlines() |
58 | 59 |
|
59 | 60 | # You may, as well, insert the SEARCH and REPLACE regexes, directly, in THIS script : |
60 | 61 |
|
61 | | -#sr_list = [ |
62 | | -# '!(?-s)(^.*?);.+!\\1!', |
63 | | -# '@(?-i)notepad\\+\\+@NOTEPAD++@', |
64 | | -# '&(Smith)|TEST|(James)&(?1Name)(?2First name)&', |
65 | | -# '%\\\\% 123 %', |
66 | | -# # or the syntax '%\x5c\x5c% 123 %', |
67 | | -# '+(?i)Fix ++', |
68 | | -# '*###*\\\\\\\\\\\\*', |
69 | | -# ] |
| 62 | +sr_list = [ |
| 63 | +r'!G90!G90 \(Absolute Programming\)!', |
| 64 | +r'!G40!G40 \(Kerf Off\)!', |
| 65 | +r'!G41!G41 \(Kerf Left\)!', |
| 66 | +r'!G42!G42 \(Kerf Right\)!', |
| 67 | +r'!G91!G91 \(Incremental Programming\)!', |
| 68 | +r'!G70!G70 \(Inch Mode\)!', |
| 69 | +r'!G84!G84 \(Deselect all Stations\)!', |
| 70 | +r'!G85\s?I(\d)(\d)\s?J(-?\d*.\d*)(\r|\n)!G85 I($1)($2) J($3) \(Fix St ($1), Move St ($2) Spacing=($3)\)!', |
| 71 | +r'!G83\s?I(\d)\s?(\r|\n)!G83 I($1)\(Select Station ($1)\)($2)!', |
| 72 | +r'!G83\s?I(\d)\s?J(\d)!G83 I($1) ($2)\(Select Station ($1) Clamp Mode=($2)\)!', |
| 73 | +r'!AL\s?(-?\d*.\d*)!AL ($1) \(Tilt to ($1) Degrees\)!', |
| 74 | +r'!(M178\s?D1)!($1) \(Send Y1 to Home\)!', |
| 75 | +r'!(M178\s?D2)!($1) \(Send Y2 to Home\)!', |
| 76 | +r'!G71!G71 \(Metric Mode\)!', |
| 77 | +r'!M65!M65 \(Plasma Start\)!', |
| 78 | +r'!M02!M02 \(Program Stop\)!', |
| 79 | +r'!M66!M66 \(Plasma Stop\)!', |
| 80 | +r'!M177!M177 \(Foot Up\)!', |
| 81 | +r'!M174!M174 \(Flying Stop\)!', |
| 82 | +r'!M176!M176 \(Foot Down\)!', |
| 83 | +r'!M35!M35 \(Rotation look ahead 1 block\)!', |
| 84 | +r'!M34!M34 \(Rotation skip block\)!', |
| 85 | +r'!M58!M58 \(AVHC Enable\)!', |
| 86 | +r'!M57!M57 \(AVHC Disable\)!', |
| 87 | +r'!M145 D0!M145 D0 \(Straight/I ORG Selection\)!', |
| 88 | +r'!M145 D1!M145 D1 \(Y ORG Selection\)!', |
| 89 | +r'!M145 D2!M145 D2 \(K ORG Selection\)!', |
| 90 | +r'!G160 P1!G160 P1 \(Plasma Process\)!', |
| 91 | +r'!G160 P2!G160 P2 \(Oxy-Fuel Process\)!', |
| 92 | +r'!M62!M62 \(Rotation Stop\Freeze\)!', |
| 93 | +r'!M63!M63 \(Rotation On\)!', |
| 94 | +r'!M64!M64 \(Rotation Off\)!', |
| 95 | +r'!D3(\r|\n)!D3 \(Comment Block Start\)($1)!', |
| 96 | +r'!D4(\r|\n)!D4 \(Comment Block End\)($1)!', |
| 97 | +r'!(M129 D(.\d)*)!($1) \(Total Material Thickness\)!', |
| 98 | +r'!(M120 D(.\d)*)!($1) \(Feature Height\)!', |
| 99 | +r'!(T\d)!($1) \(Tool Offset Select\)!' |
| 100 | +] |
70 | 101 |
|
71 | 102 | # The use of RAW strings r'.......' is also possible, in order to SIMPLIFY some regexes |
72 | 103 |
|
|
0 commit comments