Package buildslave :: Package commands :: Module registry
[frames] | no frames]

Source Code for Module buildslave.commands.registry

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
15   
16  from twisted.python import reflect 
17   
18  commandRegistry = { 
19      # command name : fully qualified factory name (callable) 
20      "shell" : "buildslave.commands.shell.SlaveShellCommand", 
21      "uploadFile" : "buildslave.commands.transfer.SlaveFileUploadCommand", 
22      "uploadDirectory" : "buildslave.commands.transfer.SlaveDirectoryUploadCommand", 
23      "downloadFile" : "buildslave.commands.transfer.SlaveFileDownloadCommand", 
24      "svn" : "buildslave.commands.svn.SVN", 
25      "bk" : "buildslave.commands.bk.BK", 
26      "cvs" : "buildslave.commands.cvs.CVS", 
27      "darcs" : "buildslave.commands.darcs.Darcs", 
28      "git" : "buildslave.commands.git.Git", 
29      "repo" : "buildslave.commands.repo.Repo", 
30      "bzr" : "buildslave.commands.bzr.Bzr", 
31      "hg" : "buildslave.commands.hg.Mercurial", 
32      "p4" : "buildslave.commands.p4.P4", 
33      "p4sync" : "buildslave.commands.p4.P4Sync", 
34      "mtn" : "buildslave.commands.mtn.Monotone", 
35      "mkdir" : "buildslave.commands.fs.MakeDirectory", 
36      "rmdir" : "buildslave.commands.fs.RemoveDirectory", 
37      "cpdir" : "buildslave.commands.fs.CopyDirectory", 
38      "stat" : "buildslave.commands.fs.StatFile", 
39  } 
40   
41 -def getFactory(command):
42 factory_name = commandRegistry[command] 43 factory = reflect.namedObject(factory_name) 44 return factory
45
46 -def getAllCommandNames():
47 return commandRegistry.keys()
48