Example #1
0
    def setUp(self):
        self.managers = [
            Manager("Bill", "Gates", 1000, 10),
            Manager("Mark", "Zuckerberg", 900, 3),
            Manager("Sergey", "Brin", 900, 1),
            Manager("Steve", "Jobs", 800, 8)
        ]
        self.depart = Department(self.managers)

        self.employees = [
            Designer("tom",
                     "taylor",
                     800,
                     10,
                     self.managers[0],
                     effect_coeff=0.5),
            Developer("dev1", "java", 500, 2, self.managers[0]),
            Developer("dev2", "js", 500, 6, self.managers[0]),
            Designer("armani",
                     "jeans",
                     1200,
                     3,
                     self.managers[1],
                     effect_coeff=1),
            Designer("dolce", "gabbana", 800, 6, self.managers[1]),
            Developer("dev3", "basic", 500, 0.5, self.managers[1]),
            Developer("dev4", "python", 500, 6)
        ]
        self.employees_salary_expected = [730, 500, 1100]
        self.managers_salary_expected = [1870]
        self.wrong_list = ["vasya", "petya", "kolya", 15, True]
Example #2
0
def main():

    managers = [
        Manager("Bill", "Gates", 1000, 10),
        Manager("Mark", "Zuckerberg", 900, 3),
        Manager("Sergey", "Brin", 900, 1),
        Manager("Steve", "Jobs", 800, 8)
        ]

    employees = [
        Designer("tom", "taylor", 800, 10, managers[0], effect_coeff=0.5),
        Developer("dev1", "java", 500, 2, managers[0]),
        Developer ("dev2", "js", 500, 6, managers[0]),

        Designer("armani", "jeans", 1200, 3, managers[1], effect_coeff=1),
        Designer("dolce", "gabbana", 800, 6, managers[1]),
        Developer ("dev3", "basic", 500, 0.5, managers[1]),

        Developer ("dev4", "python", 500, 6)
        ]

    depart = Department(managers)

    wrong_list = ["vasya","petya","kolya", 15, True]

    depart.give_salary()

    depart.add_team_members(managers[-1], employees[-1::]) # employees[-1].set_manager(managers[-1])
    depart.give_salary()

    depart.add_team_members(managers[-2], employees[-1::])  #employees[-1].set_manager(managers[-2])
    depart.give_salary()

    depart.add_team_members(managers[1], employees[-1::]) # employees[-1].set_manager()
    depart.give_salary()

    depart.add_team_members(managers[0], employees)
    depart.give_salary()

    depart.add_team_members(managers[-1], [])
    depart.give_salary()

    depart.add_team_members(managers[-1], wrong_list)
    depart.give_salary()

    wrong_list.extend(employees[-1::])
    depart.add_team_members(managers[-1], wrong_list)
    depart.give_salary()

    depart.add_team_members(managers[-1], managers[:-1:])
    depart.give_salary()
Example #3
0
 def AddStaff(self, type):
     if type == 0:
         return Director().Show("director.tpl")
     elif type == 1:
         return Finansist().Show("finansist.tpl")
     else:
         return Designer().Show("designer.tpl")
Example #4
0
 def get_designers(self, config, thicknesses, interpolations):
     designers = []
     # create a thickness/interpolation matrix of designers
     for thickness in thicknesses:
         designers.append([])
         # change the range value according to the first thickness basis
         ratio = (thickness / thicknesses[0]) ** 0.5
         range_value = np.array(self.range_value) / ratio
         for interpolation in interpolations:
             designers[-1].append(Designer(
                 input_size=self.input_size,
                 output_size=self.output_size,
                 thickness=thickness,
                 range_value=range_value,
                 fading=self.fading,
                 interpolation=interpolation
             ))
     return np.array(designers)
Example #5
0
    def Add(self, type):
        id = int(request.form.get('id', 0))

        if id == 0:
            if type == 0:
                i = Director()
            elif type == 1:
                i = Finansist()
            else:
                i = Designer()

            i.SetData()
            self.maxid += 1
            i.id = self.maxid
            self.staff[i.id] = i
        else:
            i = self.staff[id]
            i.SetData()
            self.staff[id] = i
        return self.ShowStaff()
Example #6
0
    def get_profiles(self):
        for count, des in enumerate(self.designers):
            count = count + 1

            _des = des.split('<->')
            name = _des[0].replace(';', '').strip()
            url = _des[1].strip()
            username = url.rpartition('/')[-1]

            des_folder = os.path.join(DATA_DIR, str(count) + '_' + username)
            create_folder(des_folder)

            resp = request(url)
            if resp:
                soup = BeautifulSoup(resp.text, 'lxml')
                if soup:
                    des = Designer(soup)
                    shots = des.shots()
                    projs = des.projects()
                    flw = des.followers()
                    likes = des.likes()
                    tags = des.tags()
                    email = des.email()
                    site = des.website()
                    ins = des.instagram()
                    fb = des.facebook()
                    tw = des.twitter()
                    ln = des.linkedin()
                    vm = des.vimeo()

                    data = [[
                        name, username, url, shots, projs, flw, likes, tags,
                        email, site, ins, fb, tw, ln, vm
                    ]]
                    write_csv(data, DATA_DIR, CSV_DESIGNERS)
                    print('[+] Done >> {}'.format(username))

                    if shots > 0:
                        sh = Shots(des_folder, shots, username)
                        sh.get_shots()
Example #7
0
use_gazebo = rospy.get_param("/use_gazebo")

# config #
brick_size = (0.2, 0.05, 0.1)

# scene #
scene = Scene('world')
scene.add_box('ground', (5, 5, 0.1), build_frame((0, 0, -0.05)))

# gazebo #
gazebo = GazeboUtils() if use_gazebo else None

# arm #
arm = Arm('panda_arm', 'world', build_frame((0, 0, -0.12), (0, 0, pi / 4)),
          0.03, 0.025)
arm.cartesian = True

# builder #
margin = 0.001
builder = Builder(arm,
                  scene,
                  gazebo_utils=gazebo,
                  brick_size=(brick_size[0] - margin, brick_size[1] - margin,
                              brick_size[2] - margin))

# designer #
app = wx.App()
designer = Designer(builder, (brick_size[0], brick_size[1]))
designer.Show()
app.MainLoop()
Example #8
0
from exchange import Rate
from designer import Designer

# Задание 1
print(Rate.greatest_currency())

# Задание 2
r1 = Rate(format_='value', diff=True)
r2 = Rate(format_='value', diff=False)
r3 = Rate(format_='full', diff=True)

print(r1.azn(), r2.eur(), r3.usd())

# Задание 3
# честно говоря, я не уверен, что я понял задание :(
staff1 = Designer('Zaha Hadid')
for i in range(20):
    staff1.check_if_it_is_time_for_upgrade()