예제 #1
0
 def adapt(self, params=None):
     result =  DefaultAdaptor.adapt(self, params)
     if 'job' in params:
         result.update({"SubJobDropDownList":params["job"],
                        "change":"Change of a sub-class"})
         return result
     raise InternalException(message="Job field is required!")
예제 #2
0
    def adapt(self, params=None):
        result = DefaultAdaptor.adapt(self, params)
        if self.defaults.__len__() == 0:
            return result

        result.update(self.defaults)

        if "modifyWay" in params or params["modifyWay"] == "absolute":
            for field in self.defaults:
                if field in params:
                    result[field] = params[field]
# if relative change
        else:
            for field in self.defaults:
                if field in params:
                    try:
                        result[field] = self.defaults[field] + params[field]
                    except TypeError:
                        continue


#        we will always change absolute because face and hair properties do not save if relative change
        result["modifyWay"] = "absolute"
        if "memo" in params:
            result["memo"] = params["memo"] + " Created by script"
        else:
            result["memo"] = "Created by script"

        return result
예제 #3
0
    def adapt(self, params=None):
        result = DefaultAdaptor.adapt(self, params)
        if self.defaults.__len__() == 0:
            return result

        result.update(self.defaults)

        if "modifyWay" in params or params["modifyWay"] == "absolute":
            for field in self.defaults:
                if field in params:
                    result[field] = params[field]
# if relative change
        else:
            for field in self.defaults:
                if field in params:
                    try:
                        result[field] = self.defaults[field] + params[field]
                    except TypeError:
                        continue

#        we will always change absolute because face and hair properties do not save if relative change
        result["modifyWay"] = "absolute"
        if "memo" in params:
            result["memo"] = params["memo"] + " Created by script"
        else:
            result["memo"] = "Created by script"

        return result
예제 #4
0
 def adapt(self, params=None):
     result = DefaultAdaptor.adapt(self, params)
     if 'job' in params:
         result.update({
             "SubJobDropDownList": params["job"],
             "change": "Change of a sub-class"
         })
         return result
     raise InternalException(message="Job field is required!")
예제 #5
0
 def adapt(self, params=None):
     result = DefaultAdaptor.adapt(self, params)
     if "approve" in params:
         result.update({"approve": "Approve"})
         return result
     elif "reject" in params:
         result.update({"reject": "Reject"})
         return result
     else:
         raise InternalException(message="Approve or reject?")
예제 #6
0
 def adapt(self, params=None):
     result = DefaultAdaptor.adapt(self, params)
     if "approve" in params:
         result.update({
             "approve": "Approve"
         })
         return result
     elif "reject" in params:
         result.update({
             "reject" : "Reject"
         })
         return result
     else:
         raise InternalException(message="Approve or reject?")
예제 #7
0
    def adapt(self, params=None):
    #         result is a sum of system info (Viewstate and so on) and params
        result = DefaultAdaptor.adapt(self, params)
        current_time = datetime.datetime.now()
        to_date = current_time.strftime("%Y-%m-%d %H:%M")
        #       for last day
        from_date = (current_time - datetime.timedelta(1)).strftime("%Y-%m-%d %H:%M")

        defaults = {
            #            'action': '803',
            'search': 'Search',
            'rowsPerPage': Lineage2ListLogHandler.LOGS_BY_PAGE,
            'SearchTarget': "targetChar",
            'toDate': to_date,
            'fromDate': from_date,
#            todo worldlist
            'worldList': 71
        }

        defaults.update(result)
        return defaults
예제 #8
0
    def adapt(self, params=None):
        #         result is a sum of system info (Viewstate and so on) and params
        result = DefaultAdaptor.adapt(self, params)
        current_time = datetime.datetime.now()
        to_date = current_time.strftime("%Y-%m-%d %H:%M")
        #       for last day
        from_date = (current_time -
                     datetime.timedelta(1)).strftime("%Y-%m-%d %H:%M")

        defaults = {
            #            'action': '803',
            'search': 'Search',
            'rowsPerPage': Lineage2ListLogHandler.LOGS_BY_PAGE,
            'SearchTarget': "targetChar",
            'toDate': to_date,
            'fromDate': from_date,
            #            todo worldlist
            'worldList': 71
        }

        defaults.update(result)
        return defaults
예제 #9
0
 def adapt(self, params=None):
     result = DefaultAdaptor.adapt(self, params)
     result['loginSubmit'] = 'Login'
     result['id'] = self.page.support.getLogin()
     result['password'] = self.page.support.getPassword()
     return result
예제 #10
0
 def adapt(self, params=None):
     result = DefaultAdaptor.adapt(self, params)
     result['loginSubmit'] = 'Login'
     result['id'] = self.page.support.getLogin()
     result['password'] = self.page.support.getPassword()
     return result