예제 #1
0
	def init(path, config_file=Config.CONFIGFILE):
		''' Needs the path to repo, or the repo name if specified in the config file '''
		try:
			Config.init(path, config_file)
			LocalRepo._repo = Repo(Config.get('path', path))
			Log.init(LocalRepo._repo.path)
			BuildLog.init(LocalRepo._repo.path)
			PkgbuildLog.init(LocalRepo._repo.path)
		except LocalRepoError as e:
			LocalRepo.error(e)
예제 #2
0
 def init(path, config_file=Config.CONFIGFILE):
     ''' Needs the path to repo, or the repo name if specified in the config file '''
     try:
         Config.init(path, config_file)
         LocalRepo._repo = Repo(Config.get('path', path))
         Log.init(LocalRepo._repo.path)
         BuildLog.init(LocalRepo._repo.path)
         PkgbuildLog.init(LocalRepo._repo.path)
     except LocalRepoError as e:
         LocalRepo.error(e)
예제 #3
0
파일: log.py 프로젝트: saik0/local-repo
	def test_log(self, error=False):
		msgs = ['Hello!', 'This is just a test...', 'Everything is fine... hopefully']
		Log.init(self.repo)

		for msg in msgs:
			Log.error(msg) if error else Log.log(msg)

		Log.close()

		with open(self.log) as f:
			i = 0
			p = '^\[[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}\] '

			if error:
				p += '\[\w+\] '

			for line in f:
				self.assertRegex(line, p + msgs[i] + '\n')
				i += 1
예제 #4
0
파일: log.py 프로젝트: yunchih/local-repo
    def test_log(self, error=False):
        msgs = [
            'Hello!', 'This is just a test...',
            'Everything is fine... hopefully'
        ]
        Log.init(self.repo)

        for msg in msgs:
            Log.error(msg) if error else Log.log(msg)

        Log.close()

        with open(self.log) as f:
            i = 0
            p = '^\[[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}\] '

            if error:
                p += '\[\w+\] '

            for line in f:
                self.assertRegex(line, p + msgs[i] + '\n')
                i += 1