示例#1
0
文件: git.py 项目: rh1/PortSync
	def __init__(self, repo_name, global_config_parser, user_config_parser):
		Repo.__init__(self, repo_name, global_config_parser, user_config_parser)

		# Get git command
		try:
			self.gitcmd = self.userconf[self.repo_name]["gitcmd"]
		except KeyError:
			try:
				self.gitcmd = self.globalconf["paths"]["git"]
			except KeyError:
				raise RepoError("Error. No option 'git' in section 'paths'. Please check global config file.")

		# Git commit ?
		try:
			self.gitcommit = self.userconf[self.repo_name]["commit"]
		except KeyError:
			try:
				self.gitcommit = self.globalconf["git"]["commit"]
			except KeyError:
				self.gitcommit = False

		# Commit message ?
		try:
			self.commit_message = self.userconf[self.repo_name]["commit_message"]
		except KeyError:
			try:
				self.commit_message = self.globalconf["git"]["commit_message"]
			except KeyError:
				self.commit_message = "Updated repo"

		# Push commit ?
		try:
			self.gitpush = self.userconf[self.repo_name]["gitpush"]
		except KeyError:
			self.gitpush = False
示例#2
0
文件: rsync.py 项目: rh1/PortSync
	def __init__(self, repo_name, global_config_parser, user_config_parser):
		Repo.__init__(self, repo_name, global_config_parser, user_config_parser)

		# Get rsync command
		try:
			self.rsynccmd = self.userconf[self.repo_name]["rsynccmd"]
		except KeyError:
			try:
				self.rsynccmd = self.globalconf["paths"]["rsync"]
			except KeyError:
				raise RepoError("Error: No option 'rsync' in section 'paths'. Please check global config file.")

		# Get rsync options
		try:
			self.rsyncopts = self.userconf[self.repo_name]["rsyncopts"]
		except KeyError:
			try:
				self.rsyncopts = self.globalconf["rsync"]["rsyncopts"]
			except KeyError:
				raise RepoError("Error: No option 'rsyncopts' in section 'rsync'. Please check global config file.")

		# Get any extra rsync opts
		try:
			rsync_extraopts = self.userconf[self.repo_name]["rsync_extraopts"]
		except KeyError:
			try:
				rsync_extraopts = self.globalconf["rsyncgit"]["rsync_extraopts"]
			except:
				rsync_extraopts = ""
		self.rsyncopts = "{opts} {extra_opts}".format(opts=self.rsyncopts, extra_opts=rsync_extraopts)

		# Get rsync source
		try:
			self.rsyncsrc = self.userconf[self.repo_name]["rsyncsrc"]
		except KeyError:
			raise RepoError("Error: No option 'rsyncsrc' defined for '{repo}'. Please check config file".format(repo=self.repo_name))
示例#3
0
	def __init__(self, repo_name, global_config_parser, user_config_parser):
		Repo.__init__(self, repo_name, global_config_parser, user_config_parser)
		try:
			self.svncmd = self.globalconf["paths"]["svn"]
		except KeyError:
			raise RepoError("Error. No option 'svn' in section 'paths'. Please check global config file.")