Skip to content

Commit

Permalink
2011-09-17_03-53-14
Browse files Browse the repository at this point in the history
  • Loading branch information
camerb committed Sep 17, 2011
1 parent dd067bf commit dec0cec
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 165 deletions.
3 changes: 2 additions & 1 deletion DebuggerCommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,5 @@ cmd 1: {C:\code\epms\script}, 2: {perl user_auth_expression_new.pl 3351 3369 335
cmd 1: {C:\code\epms\script\property_importers}, 2: {perl homeproperties.pl C:\import_files\prop\home_2011-08.csv 0 > C:\code\report.txt}
cmd 1: {C:\code\epms\script\employee_importers}, 2: {perl homeproperties.pl C:\import_files\empl\home_2011-08.csv 0 > C:\code\report.txt}
EPMS
cmd 1: {C:\code\epms\script\employee_importers}, 2: {perl sequoia.pl > C:\code\report.txt}
cmd 1: {C:\code\epms\script\employee_importers}, 2: {perl sequoia.pl > C:\code\report.txt}
EPMS
28 changes: 14 additions & 14 deletions FindMe_Config.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Settings]
X=2308
Y=282
Width=684
Height=743
X=2883
Y=205
Width=700
Height=781
LastDir=*C:\code\epms
LastSearch=ext.ui.

Expand All @@ -20,16 +20,16 @@ LastFile9=*C:\code\epms
LastFile10=*C:\Program Files

# Search field
lastSearch1=pixelgetcolor
lastSearch2=de.gif
lastSearch3=de.jpg
lastSearch4=de.(jpg|gif)
lastSearch5=winwaitactivetitlechange
lastSearch6=sendemailsimple
lastSearch7=include SendEmailSimple
lastSearch8=include SendEmailSimple.ahk
lastSearch9=sendemail
lastSearch10=window\.location
lastSearch1=sendemail
lastSearch2=pixelgetcolor
lastSearch3=de.gif
lastSearch4=de.jpg
lastSearch5=de.(jpg|gif)
lastSearch6=winwaitactivetitlechange
lastSearch7=sendemailsimple
lastSearch8=include SendEmailSimple
lastSearch9=include SendEmailSimple.ahk
lastSearch10=sendemail

# Replace field
lastReplace1=steve
Expand Down
6 changes: 6 additions & 0 deletions GitCommit.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Loop
ExitApp
else if (ret == "f")
break
else if (ret == "a")
break
else if (strlen(ret) == 1)
SendInput, %ret%{ENTER}
else
Expand All @@ -36,6 +38,10 @@ SendInput, q{ENTER}
if NOT commitMessage
ExitApp

;add all new files if they told us to...
if (ret == "a")
SendInput, git add --all{ENTER}

currentBranchName := GitGetCurrentBranchName()
issueNumber := GitGetIssueNumber(currentBranchName)
issueTitle := RemoveLineEndings(GitGetIssueTitle(issueNumber))
Expand Down
22 changes: 22 additions & 0 deletions Lynx-FcnLib.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include FcnLib.ahk
#include SendEmailSimpleLib.ahk

ExitApp

Expand Down Expand Up @@ -170,3 +171,24 @@ WinLogActiveStats(function, lineNumber)
%A_LoopField% := A_LoopField . ": " . %A_LoopField%
delog("Debugging window info", function, lineNumber, winTitle, width, height, xPosition, yPosition, winText)
}

;Send an email without doing any of the complex queuing stuff
SendEmailNow(sSubject, sBody, sAttach="", sTo="[email protected]", sReplyTo="[email protected]")
{
;sUsername, sPassword,

;item .= SexPanther()

sFrom := username . "@gmail.com"

sServer := "smtp.gmail.com" ; specify your SMTP server
nPort := 465 ; 25
bTLS := True ; False
nSend := 2 ; cdoSendUsingPort
nAuth := 1 ; cdoBasic
sUsername := "cameronbaustianmitsibot"
sPassword := "niftyemailpassword"

SendTheFrigginEmail(sSubject, sAttach, sTo, sReplyTo, sBody, sUsername, sPassword, sFrom, sServer, nPort, bTLS, nSend, nAuth)
}

7 changes: 3 additions & 4 deletions Lynx-Install.ahk
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include FcnLib.ahk
#include SendEmailSimpleLib.ahk

logFile=C:\Dropbox\Public\logs\%A_ComputerName%.txt

Expand Down Expand Up @@ -33,7 +32,7 @@ if (A_ScreenWidth > 1280)
debug("Starting Lynx Server Installation`n`nPress ESC at any time to cancel.")

;TODO send email status message
;SendEmailSimple("Lynx Install Starting", "there is a lynx install that is starting up right now")
;SendEmailNow("Lynx Install Starting", "there is a lynx install that is starting up right now")

if ChoseCopyInstallationFilesToHardDrive
CopyInstallationFilesToHardDrive()
Expand Down Expand Up @@ -74,7 +73,7 @@ if ChoseChangeDesktopBackground
;things that always need to be done
; (do things that are likely to fail towards the top)
TestBannerDotPlx()
SendEmailSimple("Lynx Install Finishing", "this lynx install is finishing up right now, here are the logs", logfile)
SendEmailNow("Lynx Install Finishing", "this lynx install is finishing up right now, here are the logs", logfile)
FileCopy(logfile, "C:\inetpub\logs\LynxInstallLog_ahk.txt", "overwrite")
FileRemoveDir, C:\Dropbox, 1

Expand All @@ -91,7 +90,7 @@ AppsKey & d::
Gui, Destroy
debug("log", "starting debug script")
WinLogActiveStats(A_ThisFunc, A_LineNumber)
SendEmailSimple("Test Message", A_ComputerName, logfile)
SendEmailNow("Test Message", A_ComputerName, logfile)
debug("log", "finished debug script")
ExitApp

Expand Down
Binary file modified Lynx-Install.exe
Binary file not shown.
34 changes: 1 addition & 33 deletions SendEmailSimple.ahk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include FcnLib.ahk
#include thirdParty\COM.ahk
#include SendEmailSimpleLib.ahk

;Send an email without doing any of the complex queuing stuff
SendEmailSimple(sSubject, sBody, sAttach="", sTo="[email protected]", sReplyTo="[email protected]")
Expand All @@ -18,36 +19,3 @@ SendEmailSimple(sSubject, sBody, sAttach="", sTo="[email protected]", sR

SendTheFrigginEmail(sSubject, sAttach, sTo, sReplyTo, sBody, sUsername, sPassword, sFrom, sServer, nPort, bTLS, nSend, nAuth)
}

SendTheFrigginEmail(sSubject, sAttach, sTo, sReplyTo, sBody, sUsername, sPassword, sFrom, sServer, nPort=25, bTLS=true, nSend=2, nAuth=1)
{
;TODO catch error sending email
COM_Init()
pmsg := COM_CreateObject("CDO.Message")
pcfg := COM_Invoke(pmsg, "Configuration")
pfld := COM_Invoke(pcfg, "Fields")

COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/sendusing", nSend)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/smtpserver", sServer)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/smtpserverport", nPort)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/smtpusessl", bTLS)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", nAuth)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/sendusername", sUsername)
COM_Invoke(pfld, "Item", "http://schemas.microsoft.com/cdo/configuration/sendpassword", sPassword)
COM_Invoke(pfld, "Update")

COM_Invoke(pmsg, "From", sFrom)
COM_Invoke(pmsg, "To", sTo)
COM_Invoke(pmsg, "ReplyTo", sReplyTo)
COM_Invoke(pmsg, "Subject", sSubject)
COM_Invoke(pmsg, "TextBody", sBody)
Loop, Parse, sAttach, |, %A_Space%%A_Tab%
COM_Invoke(pmsg, "AddAttachment", A_LoopField)
COM_Invoke(pmsg, "Send")

COM_Release(pfld)
COM_Release(pcfg)
COM_Release(pmsg)
COM_Term()
}
21 changes: 0 additions & 21 deletions SendEmailSimpleLib.ahk
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
#include FcnLib.ahk
#include thirdParty\COM.ahk

;Send an email without doing any of the complex queuing stuff
SendEmailSimple(sSubject, sBody, sAttach="", sTo="[email protected]", sReplyTo="[email protected]")
{
;sUsername, sPassword,

;item .= SexPanther()

sFrom := username . "@gmail.com"

sServer := "smtp.gmail.com" ; specify your SMTP server
nPort := 465 ; 25
bTLS := True ; False
nSend := 2 ; cdoSendUsingPort
nAuth := 1 ; cdoBasic
sUsername := "cameronbaustianmitsibot"
sPassword := "niftyemailpassword"

SendTheFrigginEmail(sSubject, sAttach, sTo, sReplyTo, sBody, sUsername, sPassword, sFrom, sServer, nPort, bTLS, nSend, nAuth)
}

SendTheFrigginEmail(sSubject, sAttach, sTo, sReplyTo, sBody, sUsername, sPassword, sFrom, sServer, nPort=25, bTLS=true, nSend=2, nAuth=1)
{
;TODO catch error sending email
COM_Init()
pmsg := COM_CreateObject("CDO.Message")
pcfg := COM_Invoke(pmsg, "Configuration")
Expand Down
2 changes: 1 addition & 1 deletion SendQueuedEmails.ahk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include FcnLib.ahk
#include SendEmailSimpleLib.ahk
#include SendEmailSimple.ahk

Loop, C:\DataExchange\SendEmail\*.txt
{
Expand Down
63 changes: 12 additions & 51 deletions camerb-OCR-function/OCR-tests.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,28 @@
#Include OCR.ahk
;#Include C:\Dropbox\ahks\FcnLib.ahk

;expected := "HELLO FRIENDS"
;textToType := "{enter 5}{space 20}" . expected

;Run, Notepad.exe
;Sleep, 2000
;SetTitleMatchMode, 2
;WinMove, Untitled - Notepad, , 0, 0
;Send, %textToType%
;returned := GetOCR()
;ToolTip, %returned%
;Sleep, 2000
;if NOT InStr(returned, expected)
;msgbox face
;else
;msgbox tests passed
;Process, Close, Notepad.exe


expected=Company Processes
img=C:\Dropbox\Public\ocr-tests\%expected%.jpg
SplashImage, %img%
sleep, 1000

Run http://dl.dropbox.com/u/789954/ocr-tests/%expected%.jpg
sleep, 2000

;FIXME not sure why, but if you don't move the window to the top-left
; seems like it is using the Screen CoordMode, which seems odd
WinMove, %expected%, , 0, 0
Sleep 100

returned := GetOCR()
sleep, 1000
SplashImage, Off

ToolTip, %returned%
Sleep, 2000
if NOT InStr(returned, expected)
msgbox face
else
msgbox tests passed
;else
;msgbox tests passed

ExitApp

;sometimes this helps to ensure more consistent results when switching from one window to another
;CoordMode, Mouse, Screen

;widthToScan=200
;heightToScan=50

;gui, -border +AlwaysOnTop
;gui, color, 0xFF44AA
;gui, show, w%widthToScan% h%heightToScan%,OcrPreviewWindow
;sleep, 200
;WinSet, Transparent, 50, OcrPreviewWindow

;Loop
;{
;MouseGetPos, mouseX, mouseY
;topLeftX := mouseX
;topLeftY := mouseY - heightToScan

;WinMove, OcrPreviewWindow, , % topLeftX+2, % topLeftY-2

;;NOTE: this is where the magical OCR function is called
;magicalText := GetOCR(topLeftX, topLeftY, widthToScan, heightToScan, "true")

;liveMessage=Here is the text that GetOCR() found near your mouse:`n%magicalText%`n`nPress ESC at any time to exit
;ToolTip, %liveMessage%
;Sleep, 100
;}
;;end of script (obviously this never really exits)

Esc:: ExitApp
Binary file removed camerb-OCR-function/in.jpg
Binary file not shown.
4 changes: 0 additions & 4 deletions camerb-OCR-function/in.pnm

This file was deleted.

Loading

0 comments on commit dec0cec

Please sign in to comment.