Exemplo n.º 1
0
    def __init__(self, tree):
        Base.__init__(self)
        self.__model = gtk.ListStore(
            gobject.TYPE_PYOBJECT,
            gobject.TYPE_STRING,
            gobject.TYPE_STRING,
        )
        model_sort = gtk.TreeModelSort(self.__model)
        #start in a sorted state
        model_sort.set_sort_column_id(1, gtk.SORT_ASCENDING)

        if tree:
            renderer = gtk.CellRendererText()

            tree.set_model(model_sort)
            tree.append_column(gtk.TreeViewColumn("Name", renderer, text=1))
            tree.append_column(gtk.TreeViewColumn("Value", renderer, text=2))
            tree.get_column(0).set_resizable(True)
            tree.get_column(0).set_clickable(True)
            tree.get_column(1).set_clickable(True)
            tree.get_column(0).set_sort_column_id(1)
            tree.get_column(1).set_sort_column_id(2)

            #start in a sorted state
            tree.get_column(0).set_sort_order(gtk.SORT_ASCENDING)
            tree.get_column(0).set_sort_indicator(True)
 def __init__(self, env = '', dir='', modules={}, vm=None, **kwargs):
     self.modules           = modules
     self.vm                = vm
     self.name              = env
     self.env               = env
     self.is_vm = False
     Base.__init__(self, vm, **kwargs)
Exemplo n.º 3
0
 def __init__(self, mozwebqa):
     Base.__init__(self, mozwebqa)
     longer_timeout = self.timeout * 2
     WebDriverWait(self.selenium, longer_timeout).until(
             lambda s: s.find_element(*self._sign_in_locator) and \
             s.find_element(*self._sign_in_locator).is_displayed(),
             "the sign in button has not appeared within %s" % longer_timeout)
Exemplo n.º 4
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     # Create x, y, z and camera normal axes
     self.axes.append( self.CreateArrow( Vec3(1, 0, 0), RED ) )
     self.axes.append( self.CreateArrow( Vec3(0, 1, 0), GREEN ) )
     self.axes.append( self.CreateArrow( Vec3(0, 0, 1), BLUE ) )
     self.axes.append( self.CreateSquare( Vec3(0, 0, 0), TEAL ) )
Exemplo n.º 5
0
 def __init__(self, user_id):
     Base.__init__(self, __name__)
     self.user_id = user_id
     self.config = ConfigParser.ConfigParser()
     self.config.read('config.ini')
     self.all_achievements = MootDao().get_achievements(self.user_id)
     self.all_products = MootDao().get_products(self.user_id)
Exemplo n.º 6
0
	def __init__(self, *args, **kwargs):
		Base.__init__(self, *args, **kwargs)
		
		self.drawer = DrawerSDL()
		self.camera = Camera()
		
		self.objects = [] # Things in the system (eg, planets, stations)
Exemplo n.º 7
0
 def __init__( self, label, type_, getFn, setFn, clearFn, srcComp=None, args=[] ):
     Base.__init__( self, label, type_, getFn, setFn, srcComp=srcComp )
     
     self.clearFn = clearFn
     self.args = args
     
     self.cnnctn = True
Exemplo n.º 8
0
    def __init__(self, time, battery, img_paste_ad, img_corner_mark='ad_area/corner-mark.png', ad_type='banner',
                 network='wifi', desc='', doc='', doc1st_line=15, save_path='./ok.png', logo='', background=''):
        Base.__init__(self, time, battery, img_paste_ad, ad_type, network, desc,
                         doc, save_path, conf='conf/iphone6.conf', background=background)

        self.config = ConfigParser.ConfigParser()
        self.config.read('/Users/iclick/wangqiang/autoImg/conf/wantu_iphone6.conf')
Exemplo n.º 9
0
 def __init__(self, w):
     Base.__init__(self)
     self.__fname = None
     self.__pixman = PixMan(w)
     self.__currentLine = 0
     #cache the breakpoints in this code view:
     self.__breakpoints = { }
     self.__model = gtk.ListStore(
         gobject.TYPE_OBJECT,
         gobject.TYPE_STRING,
         gobject.TYPE_STRING,
         gobject.TYPE_STRING,
     )
     self.__init_pixbufs(w)
     self.__scrolled = gtk.ScrolledWindow()
     self.__scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     self.__w = gtk.TreeView(self.__model)
     self.__thread = None
     self.__addr = 0
     self.__scrolled.add(self.__w)
     tree = self.__w
     tree.connect("button_press_event", self.__on_button_press)
     tree.set_headers_visible(False)
     tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
     # for the arrow at the current program counter:
     renderer = gtk.CellRendererPixbuf()
     tree.append_column(gtk.TreeViewColumn("", renderer, pixbuf=0))
     renderer = gtk.CellRendererText()
     tree.append_column(gtk.TreeViewColumn("", renderer, text=1))
     tree.append_column(gtk.TreeViewColumn("", renderer, text=2))
     tree.append_column(gtk.TreeViewColumn("", renderer, text=3))
Exemplo n.º 10
0
 def __init__(self, nodes_ok, nodes_fail, proxies_ok, proxies_fail):
     Base.__init__(self, stat_json=json.dumps({
         'nodes_ok': nodes_ok,
         'nodes_fail': nodes_fail,
         'proxies_ok': proxies_ok,
         'proxies_fail': proxies_fail,
     }))
Exemplo n.º 11
0
    def __init__(self):
        Base.__init__(self)
        #self.style_sheets.extend(['css/home.css'])

        self.conf = conf.getInstance()
        self.verified_user = None
        self.require_login = False
Exemplo n.º 12
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Name', str, TS.getName, TS.setName ),
         parent='TextureStage'
     )
Exemplo n.º 13
0
    def __init__(self, mozwebqa):
        Base.__init__(self, mozwebqa)

        WebDriverWait(self.selenium, self.timeout).until(
            lambda s: s.find_element(*self._email_locator) and \
            s.find_element(*self._email_locator).is_displayed(),
            "email field did not appear within %s" % self.timeout)
Exemplo n.º 14
0
 def __init__(self, pcapObj):
     """pcap = pcap file name"""
     Base.__init__(self)
     self.total = 0
     self.p = pcapObj
     format = "%(filter)-40s %(total)10d\n"
     self.msg = stringFormatMessage(format=format)
Exemplo n.º 15
0
	def __init__(self,x,y,effect,interactions=False,effectTransforms=True,interactionTransforms=True,helmertConvert=False,*args,**kwargs):
		self.effect = effect
		self.k = self.effect.shape[1] # number of effects
		self.mk = [np.unique(self.effect[:,i]).shape[0] for i in range(self.k)] # number of levels for each effect

		self.effectTransforms = effectTransforms
		self.interactionTransforms = interactionTransforms

		if type(interactions) == bool:
			self.interactions = interactions
			self._interactions = {}
			for i in range(self.k):
				for j in range(i+1,self.k):
					self._interactions[(i,j)] = True
		elif type(interactions) == list:
			self.interactions = True
			self._interactions = {}
			for i,j in interactions:
				if j < i:
					i,j = j,i
				self._interactions[(i,j)] = True

		self.helmertConvert = helmertConvert

		self.contrasts = [self.buildEffectContrastMatrix(i) for i in range(self.k)]
		self.contrasts_interaction = {}
		self.projectionMatrices = {i:self._projectionMatrix(i) for i in range(self.k)}
		for i in range(self.k):
			for j in range(i):
				if self.interactions:
 					self.contrasts_interaction[(j,i)] = np.kron(self.contrasts[j],self.contrasts[i])
					self.projectionMatrices[(j,i)] = self._projectionMatrix(j,i)
		self._effectInteractionIndex = {} # starting index for each interaction in function matrix

		Base.__init__(self,x,y,*args,**kwargs)
Exemplo n.º 16
0
    def __init__(self, time, battery, img_paste_ad, img_corner_mark='ad_area/corner-mark.png', ad_type='banner',
                 network='wifi', desc='', doc='', doc1st_line=15, save_path='./ok.png', logo=''):
        Base.__init__(self, time, battery, img_paste_ad, ad_type, network, desc,
                         doc, save_path)

        self.config = ConfigParser.ConfigParser()
        self.config.read('/Users/iclick/wangqiang/autoImg/conf/wantu_H8.conf')

        if 'feeds' == self.ad_type:
            self.logo = logo
            self.img_ad_feeds_flag = cv2.imread(self.config.get('Wantu', 'img_ad_feeds_flag'), 0)
            self.fp_ad_feeds_flag = str(imagehash.dhash(Image.fromarray(self.img_ad_feeds_flag)))
            self.logger.debug("fp_ad_feeds_flag:%s", self.fp_ad_feeds_flag)

        if 'kai' == self.ad_type:
            self.img_ad_kai_flag = cv2.imread(self.config.get('Wantu', 'img_ad_kai_flag'), 0)
            self.fp_ad_kai_flag = str(imagehash.dhash(Image.fromarray(self.img_ad_kai_flag)))
            self.logger.debug("fp_ad_kai_flag:%s", self.fp_ad_kai_flag)

        self.desired_caps = {
            'platformName': 'Android',
            'platformVersion': '4.2.2',
            'deviceName': 'Genymotion Phone - 4.2.2 - API 17 - 2.9.0',
            'appPackage': 'com.wantu.activity',
            'appActivity': '.SplashScreenActivity',
            'udid': 'WTK7N16923009805',
        }
Exemplo n.º 17
0
    def __init__(self, mozwebqa, url, expect='redirect'):
        """
        class init method
        :Args:
        - url - the confirmation url from the email
        - expect - redirect/success/reset/verify (default redirect)
        """
        Base.__init__(self, mozwebqa)

        self.selenium.get(url)

        if expect == 'redirect':
            WebDriverWait(self.selenium, self.timeout).until(
                lambda s: s.title != self._page_title,
                "Complete Registration page did not redirect")
        elif expect == 'success':
            WebDriverWait(self.selenium, self.timeout).until(
                lambda s: 'Thank you' in s.find_element(
                    *self._thank_you_locator).text,
                "Complete Registration did not succeed")
        elif expect == 'reset':
            WebDriverWait(self.selenium, self.timeout).until(
                lambda s: 'verified' in s.find_element(*self._thank_you_locator
                                                       ).text,
                "Complete Registration did not succeed")
        elif expect == 'verify':
            WebDriverWait(self.selenium, self.timeout).until(
                lambda s: s.find_element(*self._password_locator).is_displayed(
                ), "password field did not become visible")
        else:
            raise Exception('Unknown expect value: %s' % expect)
Exemplo n.º 18
0
    def __init__(self,
                 time,
                 battery,
                 img_paste_ad,
                 img_corner_mark='ad_area/corner-mark.png',
                 ad_type='banner',
                 network='wifi',
                 desc='',
                 doc='',
                 doc1st_line=15,
                 save_path='./ok.png',
                 logo='',
                 background='',
                 stars=0.0):
        Base.__init__(self,
                      time,
                      battery,
                      img_paste_ad,
                      ad_type,
                      network,
                      desc,
                      doc,
                      save_path,
                      conf='conf/iphone6.conf',
                      background=background)
        self.config = ConfigParser.ConfigParser()
        self.config.read(
            '/Users/iclick/wangqiang/autoImg/conf/qzone_iphone6.conf')

        self.stars = stars
        self.logo = logo
        self.img_split = cv2.imread(
            self.config.get('qzone', 'img_feeds_split'), 0)
        self.fp_split = str(imagehash.dhash(Image.fromarray(self.img_split)))
        self.logger.debug("fp_split:%s", self.fp_split)
Exemplo n.º 19
0
 def __init__(self, directory='', modules={}, vm=None, **kwargs):
     self.modules           = modules
     self.vm                = vm
     self.name              = directory +'@name'
     self.directory         = directory
     self.is_vm = False
     Base.__init__(self, vm, **kwargs)
Exemplo n.º 20
0
    def __init__(self, nodes):  #DONE
        Base.__init__(self, nodes)
        self.name = "Ghost"
        self.points = 200
        self.speed = 100
        self.goal = Vector2()
        self.node = nodes.points[10]
        self.target = self.node
        self.recent_position()
        self.ID = -1

        self.release_pellet = 0
        self.block = []
        self.out = False
        self.draw_release = False  #Draw normally because usually spawn means frightened sprite

        self.guide = [UP]

        self.modetime = 0  #time for a mode counting...
        self.modeCount = 0
        self.mode = [Mode(name="SCATTER", time=7), Mode(name="CHASE", time=20), \
                     Mode(name="SCATTER", time=7), Mode(name="CHASE", time=20), \
                     Mode(name="SCATTER", time=5), Mode(name="CHASE", time=20), \
                     Mode(name="SCATTER", time=5), Mode(name="CHASE")]
        """self.reset = [Mode(name="SCATTER", time=7), Mode(name="CHASE", time=20), 
                      Mode(name="SCATTER", time=7), Mode(name="CHASE", time=20), 
                      Mode(name="SCATTER", time=5), Mode(name="CHASE", time=20), 
                      Mode(name="SCATTER", time=5), Mode(name="CHASE")]"""#reset the self.mode because it can be modified by frightened mode
        #I just put here in case I need it XD
        self.spawnnode = self.findSNode()
Exemplo n.º 21
0
    def __init__(self, time, battery, img_paste_ad, img_corner_mark='ad_area/corner-mark.png', ad_type='banner',
                 network='wifi', desc='', doc='', doc1st_line=15, save_path='./ok.png', logo = ''):
        Base.__init__(self, time, battery, img_paste_ad, ad_type, network, desc,
                         doc, save_path)

        self.config = ConfigParser.ConfigParser()
        self.config.read('/Users/iclick/wangqiang/autoImg/conf/calendar_H60-L11.conf')

        self.img_ad_feeds_flag = cv2.imread(self.config.get('calendar', 'img_ad_feeds_flag'), 0)
        self.fp_ad_feeds_flag = str(imagehash.dhash(Image.fromarray(self.img_ad_feeds_flag)))
        self.img_ad_feeds_split = cv2.imread(self.config.get('calendar', 'img_ad_feeds_split'), 0)
        self.fp_ad_feeds_split = str(imagehash.dhash(Image.fromarray(self.img_ad_feeds_split)))
        self.img_ad_feeds_all = cv2.imread(self.config.get('calendar', 'img_ad_feeds_all'), 0)
        self.fp_ad_feeds_all = str(imagehash.dhash(Image.fromarray(self.img_ad_feeds_all)))
        self.logger.debug("fp_ad_feeds_flag:%s, fp_ad_feeds_split:%s, fp_ad_feeds_all:%s", self.fp_ad_feeds_flag,
                          self.fp_ad_feeds_split, self.fp_ad_feeds_all)

        self.desired_caps = {
            'platformName': 'Android',
            'platformVersion': '4.2.2',
            'deviceName': 'Genymotion Phone - 4.2.2 - API 17 - 2.9.0',
            'appPackage': 'com.youloft.calendar',
            'appActivity': '.MainActivity',
            'udid': '192.168.56.101:5555',
        }
Exemplo n.º 22
0
 def __init__(self, nodes):
     Base.__init__(self, nodes)
     self.name = "Pacman"
     self.prev = pacr
     self.last = STOP
     self.lives = 3
     self.initial_location()
Exemplo n.º 23
0
 def __init__(self, pcapObj):    
     """pcap = pcap file name"""
     Base.__init__(self)
     self.total = 0
     self.p = pcapObj
     format = "%(filter)-40s %(total)10d\n"
     self.msg = stringFormatMessage(format=format)
Exemplo n.º 24
0
    def __init__(self, addr, port, network=None):
        Base.__init__(self, DFS(addr, port))
        self.fileSystem_ = FileSystem(self.dfs_)

        if not network:
            network = Network(self.dfs_, self.fileSystem_)
        self.network_ = network
Exemplo n.º 25
0
    def __init__(self, **kwargs):
        """
      Constructor
      @ In, None
      @ Out, None
    """
        Base.__init__(self, **kwargs)
        self.name = None  # case name
        self._mode = 'sweep'  # extrema to find: min, max, sweep
        self._metric = 'NPV'  # economic metric to focus on: lcoe, profit, cost

        self.dispatch_name = None  # type of dispatcher to use
        self.dispatcher = None  # type of dispatcher to use

        self._diff_study = None  # is this only a differential study?
        self._num_samples = 1  # number of ARMA stochastic samples to use ("denoises")
        self._hist_interval = None  # time step interval, time between production points
        self._hist_len = None  # total history length, in same units as _hist_interval
        self._num_hist = None  # number of history steps, hist_len / hist_interval
        self._global_econ = {}  # global economics settings, as a pass-through
        self._increments = {}  # stepwise increments for resource balancing
        self._time_varname = 'time'  # name of the variable throughout simulation

        self._time_discretization = None  # (start, end, number) for constructing time discretization, same as argument to np.linspace
        self._Resample_T = None  # user-set increments for resources
Exemplo n.º 26
0
    def __init__(self):
        Base.__init__(self)
        with open(self.KMEANS_OBJECT_PATH) as f:
            self.kmeans = pickle.load(f)

        self.pd_feature_data = pandas.read_csv(self.AV_FEATURES_PATH,
                                            index_col=self.AV_FEATURES_INDEX_COLUMN)
Exemplo n.º 27
0
    def __init__(self, num, state=None, range_time=None, **kwargs):
        Base.__init__(self, num, state, range_time)

        self.table = 'teacher'
        self.md5Field = ['name', 'sid', 'state', 'gender']
        self.sid = self.getSid()
        self.__dict__.update(kwargs)
Exemplo n.º 28
0
 def __init__(self, w):
     Base.__init__(self)
     self.__fname = None
     self.__pixman = PixMan(w)
     self.__currentLine = 0
     #cache the breakpoints in this code view:
     self.__breakpoints = {}
     self.__model = gtk.ListStore(
         gobject.TYPE_OBJECT,
         gobject.TYPE_STRING,
         gobject.TYPE_STRING,
         gobject.TYPE_STRING,
     )
     self.__init_pixbufs(w)
     self.__scrolled = gtk.ScrolledWindow()
     self.__scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     self.__w = gtk.TreeView(self.__model)
     self.__thread = None
     self.__addr = 0
     self.__scrolled.add(self.__w)
     tree = self.__w
     tree.connect("button_press_event", self.__on_button_press)
     tree.set_headers_visible(False)
     tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
     # for the arrow at the current program counter:
     renderer = gtk.CellRendererPixbuf()
     tree.append_column(gtk.TreeViewColumn("", renderer, pixbuf=0))
     renderer = gtk.CellRendererText()
     tree.append_column(gtk.TreeViewColumn("", renderer, text=1))
     tree.append_column(gtk.TreeViewColumn("", renderer, text=2))
     tree.append_column(gtk.TreeViewColumn("", renderer, text=3))
Exemplo n.º 29
0
	def __init__(self, tree):
		Base.__init__(self)
		self.__model = gtk.ListStore(
			gobject.TYPE_PYOBJECT,
			gobject.TYPE_STRING,
			gobject.TYPE_STRING,
		)
		model_sort = gtk.TreeModelSort(self.__model)
		#start in a sorted state
		model_sort.set_sort_column_id(1, gtk.SORT_ASCENDING)

		if tree:
			renderer = gtk.CellRendererText()

			tree.set_model(model_sort)
			tree.append_column(gtk.TreeViewColumn("Name", renderer, text=1))
			tree.append_column(gtk.TreeViewColumn("Value", renderer, text=2))
			tree.get_column(0).set_resizable(True)
			tree.get_column(0).set_clickable(True)
			tree.get_column(1).set_clickable(True)
			tree.get_column(0).set_sort_column_id(1)
			tree.get_column(1).set_sort_column_id(2)

			#start in a sorted state
			tree.get_column(0).set_sort_order(gtk.SORT_ASCENDING)
			tree.get_column(0).set_sort_indicator(True)
Exemplo n.º 30
0
 def __init__(self, user_id):
     Base.__init__(self, __name__)
     self.user_id = user_id
     self.config = ConfigParser.ConfigParser()
     self.config.read('config.ini')
     self.all_achievements = MootDao().get_achievements(self.user_id)
     self.all_products = MootDao().get_products(self.user_id)
Exemplo n.º 31
0
    def __init__(self, host, port, keyspace, debug=False):
        Base.__init__(self, host, port, keyspace, BaseComplex.ident, debug)

        self.ROBOTS = BaseRobot(host, port, keyspace, debug)
        self.OBJECTS = BaseObject(host, port, keyspace, debug)
        self.SENSORS = BaseSensor(host, port, keyspace, debug)
        self.LOCATIONS = BaseLocation(host, port, keyspace, debug)
Exemplo n.º 32
0
 def __init__(self,entries=None):
     if entries:
         Base.__init__(self, entries)
         return
     self.version = '1.0'
     self.session_id = ''
     self.values = '{}'
     self.created = datetime.now()
Exemplo n.º 33
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Half Extents', pm.Vec3, BBS.getHalfExtentsWithMargin, 
               initDefault=pm.Vec3( 0.5, 0.5, 0.5 ) ),
         parent='BulletBoxShape'
     )
Exemplo n.º 34
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(Attr('Normal',
                                pm.Vec3,
                                initDefault=pm.Vec3(0, 0, 1)),
                           Attr('Constant', int, initDefault=0),
                           parent='BulletBoxShape')
Exemplo n.º 35
0
 def __init__(self, job_id, shippable_adapter):
     Base.__init__(self, __name__)
     self.script_dir = self.config['HOME']
     self.script_name = '{0}/{1}.sh'.format(self.script_dir, uuid.uuid4())
     self.job_id = job_id
     self.shippable_adapter = shippable_adapter;
     self.console_buffer = []
     self.console_buffer_lock = threading.Lock()
Exemplo n.º 36
0
    def __init__(self, xml_attributes, tagged_values, stereotypes=None):
        self.xml_attributes = xml_attributes
        self.tagged_values = tagged_values
        self.stereotypes = stereotypes

        # O instanciamento da classe superior no old-style é necessário, devido haverem classes que herdam
        # dessa classe. Por algum motivo o interpretador se enrola em instanciar usando o super().
        Base.__init__(self, xml_attributes)
Exemplo n.º 37
0
	def __init__(self):
		Base.__init__(self)
		
		self.image = None
		
		# Variables for tiled to work with.
		self.xCameraMultiplier = 1		# tells the camera which direction is positive on the x axis
		self.yCameraMultiplier = 1		# and also for the y axis			
Exemplo n.º 38
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Cnnctn( 'PhysicsWorld', BW, base.scene.GetPhysicsWorld, 
                 base.scene.SetPhysicsWorld, base.scene.ClearPhysicsWorld ),
         parent='Scene'
     )
Exemplo n.º 39
0
 def __init__(self, entries=None):
     if entries:
         Base.__init__(self, entries)
         return
     self.version = "1.0"
     self.api_id = ""
     self.api_data = {}
     self.lds = False
Exemplo n.º 40
0
 def __init__(self,entries=None):
     if entries:
         Base.__init__(self, entries)
         return
     self.version = "1.0"
     self.api_id = ''
     self.api_data = {}
     self.lds = False
Exemplo n.º 41
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Name', str, T.getName, T.setName ),
         Attr( 'Full Path', Filename, T.getFullpath, self.SetTex ),
         parent='Texture'
     )
Exemplo n.º 42
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Name', str, T.getName, T.setName, initDefault='' ),
         Attr( 'Full Path', pc.Filename, T.getFullpath, self.SetTex ),
         parent='Texture'
     )
Exemplo n.º 43
0
 def __init__(self, entries=None):
     if entries:
         Base.__init__(self, entries)
         return
     self.version = '1.0'
     self.session_id = ''
     self.values = '{}'
     self.created = datetime.now()
Exemplo n.º 44
0
    def __init__(self, xml_attributes, tagged_values, stereotypes=None):
        self.xml_attributes = xml_attributes
        self.tagged_values = tagged_values
        self.stereotypes = stereotypes

        # O instanciamento da classe superior no old-style é necessário, devido haverem classes que herdam
        # dessa classe. Por algum motivo o interpretador se enrola em instanciar usando o super().
        Base.__init__(self, xml_attributes)
Exemplo n.º 45
0
 def __init__(self, pcapObj):
     Base.__init__(self)
     self.exp = None
     self.p = pcapObj    
     self.action = None
     self.doWordSearch = 0                                
     format = "%(pattern)-10s %(proto)-5s %(source)-15s %(sport)-15s %(dest)-15s %(dport)-5s %(count)10s\n"  
     self.msg = stringFormatMessage(format=format)        
Exemplo n.º 46
0
 def __init__(self,
              url,
              id=None,
              created_date=datetime.now().strftime("%Y-%m-%d %X")):
     Base.__init__(self)
     self.id = id
     self.url = url
     self.created_date = created_date
Exemplo n.º 47
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(Cnnctn('PhysicsWorld', BW,
                                  base.scene.GetPhysicsWorld,
                                  base.scene.SetPhysicsWorld,
                                  base.scene.ClearPhysicsWorld),
                           parent='Scene')
Exemplo n.º 48
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Normal', pm.Vec3, initDefault=pm.Vec3( 0, 0, 1 ) ),
         Attr( 'Constant', int, initDefault=0 ),
         parent='BulletBoxShape'
     )
Exemplo n.º 49
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(Attr('Half Extents',
                                pm.Vec3,
                                BBS.getHalfExtentsWithMargin,
                                initDefault=pm.Vec3(0.5, 0.5, 0.5)),
                           parent='BulletBoxShape')
Exemplo n.º 50
0
 def __init__(self, **kwargs):
     Base.__init__(self, **kwargs)
     self.metadata = []
     self.template = kwargs.get("template")
     self.template_filename = os.path.basename(
         kwargs.get("template_filename"))
     self.templated_string = None
     self.original_msg = ""
Exemplo n.º 51
0
    def __init__(self, num, state=None, range_time=None, **kwargs):

        Base.__init__(self, num, state, range_time)

        self.table = 'school'
        self.md5Field = ['name', 'location', 'state']
        self.city = self.getCity()
        self.__dict__.update(kwargs)
Exemplo n.º 52
0
 def __init__(self):
     Base.__init__(self,name=None,size=None,pos=None,stat=None,col=None,img=None)
     self.velocity = 20
     self.hasReachedDestination = True
     self.endPosition = None
     self.path = []
     self.counter = 0
     self.listOfTreasures = []
Exemplo n.º 53
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(
            Attr("Center", pm.Point3, CS.getCenter, CS.setCenter),
            Attr("Radius", float, CS.getRadius, CS.setRadius),
            parent="CollisionSphere",
        )
Exemplo n.º 54
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(
            Attr("Origin", pm.Point3, CR.getOrigin, CR.setOrigin),
            Attr("Direction", pm.Vec3, CR.getDirection, CR.setDirection),
            parent="CollisionRay",
        )
Exemplo n.º 55
0
	def __init__(self):
		Base.__init__(self)
		
		# Pygame doesn't need to be initialized for what we are doing
		self.image = None
		
		# Variables for tiled to work with, specific to SDL
		self.xCameraMultiplier = 1		# tells the camera which direction is positive on the x axis
		self.yCameraMultiplier = 1		# and also for the y axis
Exemplo n.º 56
0
	def __init__(self):
		Base.__init__(self)
		
		self.map = None # The map this layer belongs to
		
		self.data = [] # List of tile numbers
		self.solid = False # True if this layer is impassible
		self.width = 0
		self.height = 0
Exemplo n.º 57
0
    def __init__(self, *args, **kwargs):
        Base.__init__(self, *args, **kwargs)

        self.AddAttributes(
            Attr("Point A", pm.Point3, CT.getPointA, CT.setPointA),
            Attr("Point B", pm.Point3, CT.getPointB, CT.setPointB),
            Attr("Radius", float, CT.getRadius, CT.setRadius),
            parent="CollisionTube",
        )
Exemplo n.º 58
0
 def __init__( self, *args, **kwargs ):
     Base.__init__( self, *args, **kwargs )
     
     self.AddAttributes(
         Attr( 'Radius', float, BCS.getRadius, initDefault=0.5 ),
         Attr( 'Height', float, BCS.getHalfHeight, initDefault=1 ),
         Attr( 'Up', int, initDefault=ZUp ),
         parent='BulletCapsuleShape'
     )