I rewrote the techbot library to make it much more modular and extendable. If you wanted to change it, it might be worth taking what I committed in the message translator and working from there.
Ged.
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Filip Navara Sent: 08 May 2008 18:08 To: ReactOS Development List Subject: Re: [ros-dev] [ros-diffs] [mpiulachs] 33344: - code refactoring - made more and more easily extensible: * commands automatically loaded from plugins dlls * declarative and automatic command parameter parsing * common code moved to base classes - other fix
This commit actually broke TechBot badly. Not only the commands don't work anymore because the parameter parsing fails somewhere in ParametersParser.HandleSwitches (for eg. !rosbug 333 or !ntstatus 2307), but also some of the commands (!ntstatus, !wm and probably !winerror) aren't guarded for the case when no parameters are passed and crash horribly with NullReferenceException. I am not going to fix it since I don't like digging into regular expressions, but I would be glad if someone could look at it. I'll bring MyTechBot back online once the bugs are fixed.
Best regards, Filip Navara
On Wed, May 7, 2008 at 4:59 PM, mpiulachs@svn.reactos.org wrote:
Author: mpiulachs Date: Wed May 7 09:59:28 2008 New Revision: 33344
URL: http://svn.reactos.org/svn/reactos?rev=33344&view=rev Log:
- code refactoring
- made more and more easily extensible:
- commands automatically loaded from plugins dlls
- declarative and automatic command parameter parsing
- common code moved to base classes
- other fixes
Added: trunk/irc/TechBot/TechBot.Console/ConsoleTechBotService.cs (with
props)
trunk/irc/TechBot/TechBot.Library/Attributes/ trunk/irc/TechBot/TechBot.Library/Attributes/CommandAttribute.cs
(with props)
trunk/irc/TechBot/TechBot.Library/Attributes/CommandParameterAliasAttribute. cs (with props)
trunk/irc/TechBot/TechBot.Library/Attributes/CommandParameterAttribute.cs (with props)
trunk/irc/TechBot/TechBot.Library/Collections/
trunk/irc/TechBot/TechBot.Library/Collections/CommandBuilderCollection.cs (with props)
trunk/irc/TechBot/TechBot.Library/Commands/ApiCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/ApiCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/Base/Command.cs - copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/Command.cs
trunk/irc/TechBot/TechBot.Library/Commands/Base/XmlLookupCommand.cs
(with props)
trunk/irc/TechBot/TechBot.Library/Commands/BugCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/BugCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/ErrorCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/ErrorCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/HelpCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/HelpCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/HresultCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/HresultCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/NtStatusCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/ReactOSBugUrl.cs - copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/ReactOSBugUrl.cs
trunk/irc/TechBot/TechBot.Library/Commands/SambaBugUrl.cs - copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/SambaBugUrl.cs
trunk/irc/TechBot/TechBot.Library/Commands/SvnCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/SvnCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/WineBugUrl.cs - copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/WineBugUrl.cs
trunk/irc/TechBot/TechBot.Library/Commands/WinerrorCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/WinerrorCommand.cs
trunk/irc/TechBot/TechBot.Library/Commands/WmCommand.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/WmCommand.cs
trunk/irc/TechBot/TechBot.Library/Factory/ trunk/irc/TechBot/TechBot.Library/Factory/CommandBuilder.cs
(with props)
trunk/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs
(with props)
trunk/irc/TechBot/TechBot.Library/ParametersParser.cs (with props) trunk/irc/TechBot/TechBot.Library/TechBotIrcService.cs
(contents, props changed)
- copied, changed from r31130,
trunk/irc/TechBot/TechBot.Library/IrcService.cs
trunk/irc/TechBot/TechBot/ProjectInstaller.cs (with props)Removed: trunk/irc/TechBot/Default.build trunk/irc/TechBot/TechBot.Library/ApiCommand.cs trunk/irc/TechBot/TechBot.Library/BugCommand.cs trunk/irc/TechBot/TechBot.Library/Command.cs trunk/irc/TechBot/TechBot.Library/ErrorCommand.cs trunk/irc/TechBot/TechBot.Library/HelpCommand.cs trunk/irc/TechBot/TechBot.Library/HresultCommand.cs trunk/irc/TechBot/TechBot.Library/IrcService.cs trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs trunk/irc/TechBot/TechBot.Library/ReactOSBugUrl.cs trunk/irc/TechBot/TechBot.Library/SambaBugUrl.cs trunk/irc/TechBot/TechBot.Library/SvnCommand.cs trunk/irc/TechBot/TechBot.Library/WineBugUrl.cs trunk/irc/TechBot/TechBot.Library/WinerrorCommand.cs trunk/irc/TechBot/TechBot.Library/WmCommand.cs trunk/irc/TechBot/TechBot.cmbx Modified: trunk/irc/TechBot/TechBot.Console/Main.cs trunk/irc/TechBot/TechBot.Console/TechBot.Console.csproj trunk/irc/TechBot/TechBot.Library/Commands/Base/XmlCommand.cs trunk/irc/TechBot/TechBot.Library/MessageContext.cs trunk/irc/TechBot/TechBot.Library/ServiceOutput.cs trunk/irc/TechBot/TechBot.Library/TechBot.Library.csproj trunk/irc/TechBot/TechBot.Library/TechBotService.cs trunk/irc/TechBot/TechBot/ServiceThread.cs trunk/irc/TechBot/TechBot/TechBot.csproj trunk/irc/TechBot/TechBot/TechBotService.cs
[This mail would be too long, it was shortened to contain the URLs
only.]
Removed: trunk/irc/TechBot/Default.build URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/Default.build?rev=33343 &view=auto
Added: trunk/irc/TechBot/TechBot.Console/ConsoleTechBotService.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Console/Console TechBotService.cs?rev=33344&view=auto
Modified: trunk/irc/TechBot/TechBot.Console/Main.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Console/Main.cs ?rev=33344&r1=33343&r2=33344&view=diff
Modified: trunk/irc/TechBot/TechBot.Console/TechBot.Console.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Console/TechBot .Console.csproj?rev=33344&r1=33343&r2=33344&view=diff
Removed: trunk/irc/TechBot/TechBot.Library/ApiCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/ApiComm and.cs?rev=33343&view=auto
Added: trunk/irc/TechBot/TechBot.Library/Attributes/CommandAttribute.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Attribu tes/CommandAttribute.cs?rev=33344&view=auto
Added:
trunk/irc/TechBot/TechBot.Library/Attributes/CommandParameterAliasAttribute. cs
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Attribu tes/CommandParameterAliasAttribute.cs?rev=33344&view=auto
Added:
trunk/irc/TechBot/TechBot.Library/Attributes/CommandParameterAttribute.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Attribu tes/CommandParameterAttribute.cs?rev=33344&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/BugCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/BugComm and.cs?rev=33343&view=auto
Added:
trunk/irc/TechBot/TechBot.Library/Collections/CommandBuilderCollection.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Collect ions/CommandBuilderCollection.cs?rev=33344&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/Command.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command .cs?rev=33343&view=auto
Copied: trunk/irc/TechBot/TechBot.Library/Commands/ApiCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/ApiCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/ApiCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/ApiCommand.cs& p1=trunk/irc/TechBot/TechBot.Library/ApiCommand.cs&r1=31130&r2=33344&rev=333 44&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/Base/Command.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/Command.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/Base/Command.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/Base/Command .cs&p1=trunk/irc/TechBot/TechBot.Library/Command.cs&r1=31130&r2=33344&rev=33 344&view=diff
Modified: trunk/irc/TechBot/TechBot.Library/Commands/Base/XmlCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/Base/XmlCommand.cs?rev=33344&r1=33343&r2=33344&view=diff
Added:
trunk/irc/TechBot/TechBot.Library/Commands/Base/XmlLookupCommand.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/Base/XmlLookupCommand.cs?rev=33344&view=auto
Copied: trunk/irc/TechBot/TechBot.Library/Commands/BugCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/BugCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/BugCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/BugCommand.cs& p1=trunk/irc/TechBot/TechBot.Library/BugCommand.cs&r1=31130&r2=33344&rev=333 44&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/ErrorCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/ErrorCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/ErrorCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/ErrorCommand .cs&p1=trunk/irc/TechBot/TechBot.Library/ErrorCommand.cs&r1=31130&r2=33344&r ev=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/HelpCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/HelpCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/HelpCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/HelpCommand.c s&p1=trunk/irc/TechBot/TechBot.Library/HelpCommand.cs&r1=31130&r2=33344&rev= 33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/HresultCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/HresultCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/HresultCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/HresultCom mand.cs&p1=trunk/irc/TechBot/TechBot.Library/HresultCommand.cs&r1=31130&r2=3 3344&rev=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/NtStatusCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/NtStatusCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/NtStatusC ommand.cs&p1=trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs&r1=31130&r 2=33344&rev=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/ReactOSBugUrl.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/ReactOSBugUrl.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/ReactOSBugUrl.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/ReactOSBugU rl.cs&p1=trunk/irc/TechBot/TechBot.Library/ReactOSBugUrl.cs&r1=31130&r2=3334 4&rev=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/SambaBugUrl.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/SambaBugUrl.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/SambaBugUrl.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/SambaBugUrl.c s&p1=trunk/irc/TechBot/TechBot.Library/SambaBugUrl.cs&r1=31130&r2=33344&rev= 33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/SvnCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/SvnCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/SvnCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/SvnCommand.cs& p1=trunk/irc/TechBot/TechBot.Library/SvnCommand.cs&r1=31130&r2=33344&rev=333 44&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/WineBugUrl.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/WineBugUrl.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/WineBugUrl.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/WineBugUrl.cs& p1=trunk/irc/TechBot/TechBot.Library/WineBugUrl.cs&r1=31130&r2=33344&rev=333 44&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/WinerrorCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/WinerrorCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/WinerrorCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/WinerrorC ommand.cs&p1=trunk/irc/TechBot/TechBot.Library/WinerrorCommand.cs&r1=31130&r 2=33344&rev=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/Commands/WmCommand.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/WmCommand.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Command s/WmCommand.cs?p2=trunk/irc/TechBot/TechBot.Library/Commands/WmCommand.cs&p1 =trunk/irc/TechBot/TechBot.Library/WmCommand.cs&r1=31130&r2=33344&rev=33344& view=diff
Removed: trunk/irc/TechBot/TechBot.Library/ErrorCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/ErrorCo mmand.cs?rev=33343&view=auto
Added: trunk/irc/TechBot/TechBot.Library/Factory/CommandBuilder.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Factory /CommandBuilder.cs?rev=33344&view=auto
Added: trunk/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Factory /CommandFactory.cs?rev=33344&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/HelpCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/HelpCom mand.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/HresultCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Hresult Command.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/IrcService.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/IrcServ ice.cs?rev=33343&view=auto
Modified: trunk/irc/TechBot/TechBot.Library/MessageContext.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Message Context.cs?rev=33344&r1=33343&r2=33344&view=diff
Removed: trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/NtStatu sCommand.cs?rev=33343&view=auto
Added: trunk/irc/TechBot/TechBot.Library/ParametersParser.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Paramet ersParser.cs?rev=33344&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/ReactOSBugUrl.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/ReactOS BugUrl.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/SambaBugUrl.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/SambaBu gUrl.cs?rev=33343&view=auto
Modified: trunk/irc/TechBot/TechBot.Library/ServiceOutput.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Service Output.cs?rev=33344&r1=33343&r2=33344&view=diff
Removed: trunk/irc/TechBot/TechBot.Library/SvnCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/SvnComm and.cs?rev=33343&view=auto
Modified: trunk/irc/TechBot/TechBot.Library/TechBot.Library.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/TechBot .Library.csproj?rev=33344&r1=33343&r2=33344&view=diff
Copied: trunk/irc/TechBot/TechBot.Library/TechBotIrcService.cs
(from r31130, trunk/irc/TechBot/TechBot.Library/IrcService.cs)
URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/TechBot IrcService.cs?p2=trunk/irc/TechBot/TechBot.Library/TechBotIrcService.cs&p1=t runk/irc/TechBot/TechBot.Library/IrcService.cs&r1=31130&r2=33344&rev=33344&v iew=diff
Modified: trunk/irc/TechBot/TechBot.Library/TechBotService.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/TechBot Service.cs?rev=33344&r1=33343&r2=33344&view=diff
Removed: trunk/irc/TechBot/TechBot.Library/WineBugUrl.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/WineBug Url.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/WinerrorCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/Winerro rCommand.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.Library/WmCommand.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.Library/WmComma nd.cs?rev=33343&view=auto
Removed: trunk/irc/TechBot/TechBot.cmbx URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot.cmbx?rev=33343&... view=auto
Added: trunk/irc/TechBot/TechBot/ProjectInstaller.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot/ProjectInstalle r.cs?rev=33344&view=auto
Modified: trunk/irc/TechBot/TechBot/ServiceThread.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot/ServiceThread.c s?rev=33344&r1=33343&r2=33344&view=diff
Modified: trunk/irc/TechBot/TechBot/TechBot.csproj URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot/TechBot.csproj? rev=33344&r1=33343&r2=33344&view=diff
Modified: trunk/irc/TechBot/TechBot/TechBotService.cs URL:
http://svn.reactos.org/svn/reactos/trunk/irc/TechBot/TechBot/TechBotService. cs?rev=33344&r1=33343&r2=33344&view=diff
_______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev