<commit_before>#!/usr/bin/python
# _*_ coding: UTF-8 _*_

__author__ = 'Junhg'

# create: 2016/10/24
# version: 0.0.1
# author: Junhg
# contribute:
# 

from BasicObject import JHBasicObject

class JHViewObject(JHBasicObject):
	def __init__(self):
			pass

	def __del__(self):
			pass

	def addSubview(self, attribView):
		classViewName = self.attribViewTag(attribView)
		classViewAttrib = self.attribViewTagProperty(attribView)

		describle = JHBasicObject.addSubview(self,attribView)

		if attribView.get('clearsContextBeforeDrawing', 'YES') != 'YES':
			describle +="	"+classViewName+".clearsContextBeforeDrawing = "+attribView.get('clearsContextBeforeDrawing', 'YES')+";\n"
			pass

		if classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES') != 'YES':
			describle +="	"+classViewName+".translatesAutoresizingMaskIntoConstraints = "+classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES')+';\n'
			pass
		
		if attribView.get('contentVerticalAlignment', 'center') != 'center':
			describle +="	"+classViewName+".contentVerticalAlignment = "+self.getControlContentVerticalAlignment(attribView.get('contentVerticalAlignment', 'center'))+";\n"
			pass
		

		if attribView.get('contentHorizontalAlignment', 'center') != 'center':
			describle +="	"+classViewName+".contentHorizontalAlignment = "+self.getControlContentHorizontalAlignment(attribView.get('contentHorizontalAlignment', 'center'))+";\n"
			pass

		return describle

	def loadView(self, attribView):
		describle = "\n- (void)loadView\n{\n"

		if len(self.getClassFrame(attribView.get('rect', {}))) > 0:
			describle +="	self.view = [[UIView alloc] initWithFrame:"+self.getClassFrame(attribView.get('rect', {}))+"];\n"
			pass
		else:
			describle +="	self.view = [[UIView alloc] init];\n"
			pass
		pass
			
		for color in attribView.get('color', {}):
			if len(color.get('key','')) > 0 and color.get('key','') != 'textColor':
				describle +="	self.view."+color.get('key','')+" = "+self.getClassColor(color)+";\n"
				pass
			pass
		
		if self.getAutoresizingMask(attribView.get('autoresizingMask', {})) != 'UIViewAutoresizingNone':
			describle +="	self.view.autoresizingMask = "+self.getAutoresizingMask(attribView.get('autoresizingMask', {}))+";\n"
			pass
		
		if self.getContentModel(attribView.get('contentMode', 'scaleToFill')) != 'UIViewContentModeScaleToFill':
			describle +="	self.view.contentMode = "+self.getContentModel(attribView.get('contentMode', 'scaleToFill'))+";\n"
			pass

		if attribView.get('opaque', 'YES') != 'YES':
			describle +="	self.view.opaque = "+attribView.get('opaque', 'YES')+";\n"
			pass

		if attribView.get('clearsContextBeforeDrawing', 'YES') != 'YES':
			describle +="	self.view.clearsContextBeforeDrawing = "+attribView.get('clearsContextBeforeDrawing', 'YES')+";\n"
			pass

		if classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES') != 'YES':
			describle +="	self.view.translatesAutoresizingMaskIntoConstraints = "+classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES')+';\n'
			pass

		if attribView.get('contentVerticalAlignment', 'center') != 'center':
			describle +="	self.view.contentVerticalAlignment = "+self.getControlContentVerticalAlignment(attribView.get('contentVerticalAlignment', 'center'))+";\n"
			pass
		
		if attribView.get('contentHorizontalAlignment', 'center') != 'center':
			describle +="	self.view.contentHorizontalAlignment = "+self.getControlContentHorizontalAlignment(attribView.get('contentHorizontalAlignment', 'center'))+";\n"
			pass

		describle += "}\n"

		return describle
<commit_msg>add classViewAttrib in viewObject<commit_after>#!/usr/bin/python
# _*_ coding: UTF-8 _*_

__author__ = 'Junhg'

# create: 2016/10/24
# version: 0.0.1
# author: Junhg
# contribute:
# 

from BasicObject import JHBasicObject

class JHViewObject(JHBasicObject):
	def __init__(self):
			pass

	def __del__(self):
			pass

	def addSubview(self, attribView):
		classViewName = self.attribViewTag(attribView)
		classViewAttrib = self.attribViewTagProperty(attribView)

		describle = JHBasicObject.addSubview(self,attribView)

		if attribView.get('clearsContextBeforeDrawing', 'YES') != 'YES':
			describle +="	"+classViewName+".clearsContextBeforeDrawing = "+attribView.get('clearsContextBeforeDrawing', 'YES')+";\n"
			pass

		if classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES') != 'YES':
			describle +="	"+classViewName+".translatesAutoresizingMaskIntoConstraints = "+classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES')+';\n'
			pass
		
		if attribView.get('contentVerticalAlignment', 'center') != 'center':
			describle +="	"+classViewName+".contentVerticalAlignment = "+self.getControlContentVerticalAlignment(attribView.get('contentVerticalAlignment', 'center'))+";\n"
			pass
		

		if attribView.get('contentHorizontalAlignment', 'center') != 'center':
			describle +="	"+classViewName+".contentHorizontalAlignment = "+self.getControlContentHorizontalAlignment(attribView.get('contentHorizontalAlignment', 'center'))+";\n"
			pass

		return describle

	def loadView(self, attribView):
		classViewAttrib = self.attribViewTagProperty(attribView)
		
		describle = "\n- (void)loadView\n{\n"

		if len(self.getClassFrame(attribView.get('rect', {}))) > 0:
			describle +="	self.view = [[UIView alloc] initWithFrame:"+self.getClassFrame(attribView.get('rect', {}))+"];\n"
			pass
		else:
			describle +="	self.view = [[UIView alloc] init];\n"
			pass
		pass
			
		for color in attribView.get('color', {}):
			if len(color.get('key','')) > 0 and color.get('key','') != 'textColor':
				describle +="	self.view."+color.get('key','')+" = "+self.getClassColor(color)+";\n"
				pass
			pass
		
		if self.getAutoresizingMask(attribView.get('autoresizingMask', {})) != 'UIViewAutoresizingNone':
			describle +="	self.view.autoresizingMask = "+self.getAutoresizingMask(attribView.get('autoresizingMask', {}))+";\n"
			pass
		
		if self.getContentModel(attribView.get('contentMode', 'scaleToFill')) != 'UIViewContentModeScaleToFill':
			describle +="	self.view.contentMode = "+self.getContentModel(attribView.get('contentMode', 'scaleToFill'))+";\n"
			pass

		if attribView.get('opaque', 'YES') != 'YES':
			describle +="	self.view.opaque = "+attribView.get('opaque', 'YES')+";\n"
			pass

		if attribView.get('clearsContextBeforeDrawing', 'YES') != 'YES':
			describle +="	self.view.clearsContextBeforeDrawing = "+attribView.get('clearsContextBeforeDrawing', 'YES')+";\n"
			pass

		if classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES') != 'YES':
			describle +="	self.view.translatesAutoresizingMaskIntoConstraints = "+classViewAttrib.get('translatesAutoresizingMaskIntoConstraints', 'YES')+';\n'
			pass

		if attribView.get('contentVerticalAlignment', 'center') != 'center':
			describle +="	self.view.contentVerticalAlignment = "+self.getControlContentVerticalAlignment(attribView.get('contentVerticalAlignment', 'center'))+";\n"
			pass
		
		if attribView.get('contentHorizontalAlignment', 'center') != 'center':
			describle +="	self.view.contentHorizontalAlignment = "+self.getControlContentHorizontalAlignment(attribView.get('contentHorizontalAlignment', 'center'))+";\n"
			pass

		describle += "}\n"

		return describle

{'fraction_non_alphanumeric': 0.16602528862012095, 'fraction_numerical': 0.0038482682792743265, 'mean_word_length': 6.030917874396136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5091652', 'n_tokens_mistral': 2651, 'n_tokens_neox': 2396, 'n_words': 357}