コード例 #1
0
def run():
    # __file__ contains <submin-dir>/dispatch/cgirunner.py
    submin_www_dir = os.path.dirname(__file__)
    submin_dir = os.path.dirname(submin_www_dir)

    from submin.bootstrap import SubminInstallationCheck
    check = SubminInstallationCheck(submin_dir)
    if not check.ok:
        print "Status: 500\r\n\r\n",
        print check.error_page()
        sys.exit(0)

    from submin.models import storage
    storage.open()

    try:
        from submin.dispatch.cgirequest import CGIRequest
        from submin.dispatch.dispatcher import dispatcher

        req = CGIRequest()
        response = dispatcher(req)
        req.writeResponse(response)
    except Exception as e:
        import traceback
        trace = traceback.extract_tb(sys.exc_info()[2])
        list = traceback.format_list(trace)
        list.append(str(e))
        print "Status: 500\r\n\r\n",
        print ''.join(list)

    storage.close()
コード例 #2
0
ファイル: cgirunner.py プロジェクト: andy-deng/submin
def run():
	# __file__ contains <submin-dir>/dispatch/cgirunner.py
	submin_www_dir = os.path.dirname(__file__)
	submin_dir = os.path.dirname(submin_www_dir)

	from submin.bootstrap import SubminInstallationCheck
	check = SubminInstallationCheck(submin_dir)
	if not check.ok:
		print "Status: 500\r\n\r\n",
		print check.error_page()
		sys.exit(0)

	from submin.models import storage
	storage.open()

	try:
		from submin.dispatch.cgirequest import CGIRequest
		from submin.dispatch.dispatcher import dispatcher

		req = CGIRequest()
		response = dispatcher(req)
		req.writeResponse(response)
	except Exception as e:
		import traceback
		trace = traceback.extract_tb(sys.exc_info()[2])
		list = traceback.format_list(trace)
		list.append(str(e))
		print "Status: 500\r\n\r\n",
		print ''.join(list)

	storage.close()
コード例 #3
0
ファイル: repository.py プロジェクト: andy-deng/submin
	def tearDown(self):
		storage.close()
		if self.has_invalidperm:
			os.system("chmod 777 '%s'" % os.path.join(self.svn_dir, 'invalidperm'))
			self.has_invalidperm = False

		if self.has_invalidperm2:
			os.system("chmod 777 '%s'" % \
				os.path.join(self.svn_dir, 'invalidperm2', 'db', 'revs'))
			self.has_invalidperm2

		os.system("rm -rf '%s'" % self.submin_env)
コード例 #4
0
ファイル: repository.py プロジェクト: andreash/submin
    def tearDown(self):
        storage.close()
        if self.has_invalidperm:
            os.system("chmod 777 '%s'" %
                      os.path.join(self.svn_dir, 'invalidperm'))
            self.has_invalidperm = False

        if self.has_invalidperm2:
            os.system("chmod 777 '%s'" % \
             os.path.join(self.svn_dir, 'invalidperm2', 'db', 'revs'))
            self.has_invalidperm2

        os.system("rm -rf '%s'" % self.submin_env)
コード例 #5
0
 def tearDown(self):
     storage.close()
     shutil.rmtree(self.submin_env)
     sys.stdout = self.saved_stdout
コード例 #6
0
 def tearDown(self):
     storage.close()
コード例 #7
0
 def tearDown(self):
     storage.close()
     shutil.rmtree(self.submin_env)
コード例 #8
0
ファイル: options.py プロジェクト: andy-deng/submin
	def tearDown(self):
		storage.close()
コード例 #9
0
ファイル: multimailhook.py プロジェクト: sundysj/submin
	def __del__(self):
		storage.close()
コード例 #10
0
ファイル: trac.py プロジェクト: andy-deng/submin
	def tearDown(self):
		storage.close()
		os.system("rm -rf '%s'" % self.submin_env)
コード例 #11
0
	def __del__(self):
		if self.storage_opened:
			try:
				storage.close()
			except storage.StorageError:
				pass # this only happens if initenv is not called yet
コード例 #12
0
ファイル: unittests.py プロジェクト: andy-deng/submin
	def tearDown(self):
		storage.close()
		shutil.rmtree(self.submin_env)
		sys.stdout = self.saved_stdout
コード例 #13
0
ファイル: groups.py プロジェクト: andy-deng/submin
	def tearDown(self):
		storage.close()
		shutil.rmtree(self.submin_env)
コード例 #14
0
ファイル: trac.py プロジェクト: wvanleeuwenbrandenburg/submin
 def tearDown(self):
     storage.close()
     os.system("rm -rf '%s'" % self.submin_env)