Esempio n. 1
0
	def start(self, domain):
		if (self.process != None):
			return

		self.domain = domain
		self.filename = common.get_full_path(self.executableName + '.log')

		self.writer = open(self.filename, 'wb')
		self.reader = open(self.filename, 'rb', 1)

		if (hasattr(sys, 'frozen')):
			self.process = subprocess.Popen([os.path.join(os.path.dirname(os.path.realpath(sys.executable)), self.executableName), self.domain], stdout=self.writer, stderr=self.writer)
		else:
			self.process = subprocess.Popen([sys.executable, os.path.join(os.path.dirname(os.path.realpath(__file__)), self.executableName), self.domain], stdout=self.writer, stderr=self.writer)
Esempio n. 2
0
def check_domains(domain_base):
	import os.path

	app_config = common.read_config()

	extensions = read_extensions(common.get_full_path(app_config['ExtensionsFile']))

	domains_to_check = set()

	for e in extensions:
		domains_to_check.add(domain_base+'.'+e)

	domains_info = api_check_domains(domains_to_check, app_config['RrpproxyLogin'], app_config['RrpproxyPw'])

	write_csv(domains_info, domain_base, os.path.join(app_config['OutputPath'], domain_base+'.csv'))
Esempio n. 3
0
def write_csv(domains, base, output):
	import os, os.path

	output_path = common.get_full_path(output)
	os.makedirs(os.path.dirname(output_path), 0o755, True)

	f = open(output_path, 'wt')
	
	f.write('sep=,\nDomain,Extension,Availability\n')

	for d in domains:
		if (isinstance(domains[d], str)):
			f.write('%s,%s,%s\n'%(d,d[len(base):],domains[d]))
		else:
			f.write('%s,%s,%s\n'%(d,d[len(base):],'available' if (domains[d]) else 'not available'))

	f.close()
Esempio n. 4
0
	def browser(self):
		import sys, subprocess, os.path, os

		if sys.platform == 'darwin':
			def openFolder(path):
				subprocess.call(['open', path])
		elif sys.platform.startswith('linux'):
			def openFolder(path):
				subprocess.call(['gnome-open', path])
		elif sys.platform == 'win32':
			def openFolder(path):
				subprocess.call(['explorer', path])

		app_config = common.read_config()

		output_path = common.get_full_path(app_config['OutputPath'])
		os.makedirs(output_path, 0o755, True)
		openFolder(output_path)