Commit ad14327a authored by Koen Martens's avatar Koen Martens

Open gedit stand-alone, fix error capturing.

parent 75eb7892
......@@ -3,13 +3,13 @@
<MudletPackage version="1.001">
<TriggerPackage>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Lambdamoo local edit</name>
<name>lambdamoo-edit</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<packageName>lambdamoo-edit</packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
......@@ -17,13 +17,9 @@
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList />
<regexCodePropertyList />
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Start capture</name>
<script>lledit.lines = {}
lledit.capture = true
lledit.name = matches[2]
lledit.upload = matches[3]
</script>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Lambdamoo local edit</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
......@@ -34,39 +30,58 @@ lledit.upload = matches[3]
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^#\$# edit name: (.*) upload: (.*)$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Capture</name>
<script>if lledit.capture and string.sub(matches[1], 1, 8) ~= "#$# edit" and matches[1] ~= "." then
<regexCodeList />
<regexCodePropertyList />
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Start capture</name>
<script>lledit.lines = {}
lledit.capture = true
lledit.name = matches[2]
lledit.upload = matches[3]
</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^#\$# edit name: (.*) upload: (.*)$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Capture</name>
<script>if lledit.capture and string.sub(matches[1], 1, 8) ~= "#$# edit" and matches[1] ~= "." then
table.insert(lledit.lines, matches[1])
end
</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^(.*)$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>End capture</name>
<script>lledit.capture = false
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^(.*)$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>End capture</name>
<script>lledit.capture = false
lledit.filename = "/tmp/" .. getTime(true, "yyyyMMddHHmmsszzz") .. ".mudlet.txt"
......@@ -76,26 +91,26 @@ save_lines(lledit.filename, lledit.lines)
edit(lledit.filename, lledit.name, lledit.upload)
</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^\.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Capture error</name>
<script>if lledit.capture_error then
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^\.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Capture error</name>
<script>if lledit.capture_error then
lledit.capture_error = false
if matches[2] == "0" then
os.remove(lledit.filename)
......@@ -103,23 +118,24 @@ edit(lledit.filename, lledit.name, lledit.upload)
edit(lledit.filename, lledit.name, lledit.upload)
end
end</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^([0-9]+) error</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^([0-9]+) error</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
</TriggerGroup>
</TriggerPackage>
<TimerPackage />
......@@ -127,19 +143,24 @@ end</script>
<ActionPackage />
<ScriptPackage>
<ScriptGroup isActive="yes" isFolder="yes">
<name>LambdaMOO local edit</name>
<packageName></packageName>
<script>-------------------------------------------------
<name>lambdamoo-edit</name>
<packageName>lambdamoo-edit</packageName>
<script></script>
<eventHandlerList />
<ScriptGroup isActive="yes" isFolder="yes">
<name>LambdaMOO local edit</name>
<packageName></packageName>
<script>-------------------------------------------------
-- Put your Lua functions here. --
-- --
-- Note that you can also use external Scripts --
-------------------------------------------------
</script>
<eventHandlerList />
<Script isActive="no" isFolder="no">
<name>Init</name>
<packageName></packageName>
<script>lledit = {
<eventHandlerList />
<Script isActive="no" isFolder="no">
<name>Init</name>
<packageName></packageName>
<script>lledit = {
capture = false,
capture_error = false,
filename = "",
......@@ -148,12 +169,12 @@ end</script>
lines = {}
};
</script>
<eventHandlerList />
</Script>
<Script isActive="no" isFolder="no">
<name>File I/O</name>
<packageName></packageName>
<script>function save_lines(filename, lines)
<eventHandlerList />
</Script>
<Script isActive="no" isFolder="no">
<name>File I/O</name>
<packageName></packageName>
<script>function save_lines(filename, lines)
local file = io.open(filename, "w")
io.output(file)
for index, line in ipairs(lines) do
......@@ -170,13 +191,13 @@ function load_lines(filename)
return lines
end
</script>
<eventHandlerList />
</Script>
<Script isActive="no" isFolder="no">
<name>Edit</name>
<packageName></packageName>
<script>function edit(filename, name, upload)
local editor = spawn(display, "gedit", filename)
<eventHandlerList />
</Script>
<Script isActive="no" isFolder="no">
<name>Edit</name>
<packageName></packageName>
<script>function edit(filename, name, upload)
local editor = spawn(display, "gedit", "-s", filename)
local reminderInterval = 100
local reminderTimer = reminderInterval
......@@ -195,6 +216,7 @@ end
local lines = load_lines(filename)
lledit.capture_error = true
send(lledit.upload .. "\n")
for index, line in pairs(lines) do
if line == "." then
......@@ -204,16 +226,15 @@ end
end
end
send(".\n")
edit_capture_errors = true
end
end
tempTimer(0.1, checkRunning)
end
</script>
<eventHandlerList />
</Script>
<eventHandlerList />
</Script>
</ScriptGroup>
</ScriptGroup>
</ScriptPackage>
<KeyPackage />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment