def main(testing_flag):
    config = ConfigParser.ConfigParser()
    config.read("config.ini")

    # Get credentials from config file
    user = config.get("credentials", "user")
    password = config.get("credentials", "password")
    project = config.get("credentials", "project")

    # If the testing flag is passed, use the test server, otherwise use the live server
    if testing_flag:
        url = config.get("server", "test")
    else:
        url = config.get("server", "live")

    # Get a server object to perform queries
    server = TacticServerStub(server=url, project=project, user=user, password=password)

    # Get titles marked as 'hot' items
    hot_titles = server.eval("@SOBJECT(twog/title['bigboard', 'True']['status', '!=', 'Completed'])")

    # Iterate through the titles, getting the client code and platform for each one
    for title in hot_titles:
        client_code = title.get("client_code")
        platform_name = title.get("platform")

        # Unfortunately, Titles hold the platform name, not the code, so a query has to be done to get that
        platform_code_search = server.eval("@SOBJECT(twog/platform['name', '{0}'])".format(platform_name))

        # This search returns a list (since multiple matches by 'name' is possible). Since this is just a quick, dirty
        # script to insert some example connections, we will take only the first result and ignore the rest.
        if platform_code_search:
            platform_code = platform_code_search[0].get("code")
        else:
            continue

        existing_connection_search = server.eval(
            "@SOBJECT(twog/client_platform['client_code', '{0}']['platform_code', '{1}'])".format(
                client_code, platform_code
            )
        )

        if not existing_connection_search:
            client_name_search = server.eval("@SOBJECT(twog/client['code', '{0}'])".format(client_code))

            if client_name_search:
                client_name = client_name_search[0].get("name")

                # Finally, insert the entry into the twog/client_platform table.
                server.insert(
                    "twog/client_platform",
                    {
                        "client_code": client_code,
                        "platform_code": platform_code,
                        "name": "{0} to {1}".format(client_name, platform_name),
                        "connection_status": "disconnected",
                    },
                )
    def get_element_eval_from_tactic_one(element_eval_code, username, password):
        server = TacticServerStub(server='http://tactic01.2gdigital.com', project='twog', user=username,
                                  password=password)

        element_eval = server.eval("@SOBJECT(twog/element_eval['code', '{0}'])".format(element_eval_code))
        element_eval_lines = server.eval("@SOBJECT(twog/element_eval_lines['element_eval_code', '{0}'])".format(element_eval_code))
        element_eval_audio_lines = server.eval("@SOBJECT(twog/element_eval_audio['element_eval_code', '{0}'])".format(element_eval_code))

        print(element_eval)
        print(element_eval_lines)
        print(element_eval_audio_lines)
def main(testing_flag):
    config = ConfigParser.ConfigParser()
    config.read('config.ini')

    # Get credentials from config file
    user = config.get('credentials', 'user')
    password = config.get('credentials', 'password')
    project = config.get('credentials', 'project')

    # If the testing flag is passed, use the test server, otherwise use the live server
    if testing_flag:
        url = config.get('server', 'test')
    else:
        url = config.get('server', 'live')

    # Get a server object to perform queries
    server = TacticServerStub(server=url, project=project, user=user, password=password)

    territories_str = 'Afghanistan|Aland Islands|Albania|Algeria|American Samoa|Andorra|Angola|Anguilla|Antigua and Barbuda|Argentina|Armenia|Aruba|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia|Bonaire|Bosnia and Herzegovina|Botswana|Bouvet Island|Brazil|Brunei Darussalam|Bulgaria|Burkina Faso|Burundi|Cambodia|Cameroon|Canada|Cantonese|Cape Verde|Cayman Islands|Central African Republic|Chad|Chile|China|Christmas Island|Cocos Islands|Colombia|Comoros|Congo|Dem. Rep. of Congo|Cook Islands|Costa Rica|Croatia|Cuba|Curacao|Cyprus|Czech|Denmark|Djibouti|Dominica|Dominican Republic|Ecuador|Egypt|El Salvador|English|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Falkland Islands|Faroe Islands|Fiji|Finland|France|French Guiana|French Polynesia|Gabon|Gambia|Georgia|Germany|Ghana|Gibraltar|Greece|Greek|Greenland|Grenada|Guadeloupe|Guam|Guatemala|Guernsey|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hong Kong|Hungary|Iceland|India|Indonesia|Iran|Iraq|Ireland|Isle of Man|Israel|Italy|Ivory Coast|Jamaica|Japan|Jersey|Jordan|Kazakhstan|Kenya|Kiribati|Kuwait|Kyrgyztan|Laos|Latin America|Latin Spanish|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luzembourg|Macao|Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|Martinique|Mauritania|Mauritius|Mayotte|Mexico|Micronesia|Moldova|Monaco|Mongolia|Montenegro|Montserrat|Morocco|Mozambique|Multi-language|Myanmar|Namibia|Nauru|Nepal|Netherlands|New Caledonia|New Zealand|Nicaragua|Niger|Nigeria|Niue|Norfolk Island|North Korea|Northern Mariana Islands|Norway|Oman|Pakistan|Palau|Palestine|Panama|Papua New Guinea|Pan-Asia|Paraguay|Peru|Philippines|Pitcairn|Poland|Portugal|Puerto Rico|Qatar|Reunion|Romania|Russia|Russian|Rwanda|St Barthelemy|St Helena|St Kitts and Nevis|St Lucia|St Martin|St Pierre and Miquelo|St Vincent and Grenadines|Samoa|San Marino|Sao Tome and Principe|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Signapore|Sint Maarten|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|South Georgia and Swch Islands|South Korea|South Sudan|Spain|Sri Lanka|Sudan|Suriname|Svalbard|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thai|Thailand|Timor-Leste|Togo|Tokelau|Tonga|Trinidad and Tobago|Tunisia|Turkey|Turkmenistan|Turks and Caicos Islands|Tuvalu|Uganda|Ukraine|UAE|United Kingdom|United States|Uruguay|Uzbekistan|Vanuatu|Various|Vatican|Venezuela|Vietnam|Virgin Islands|Wallis and Futuna|West Indies|Western Sahara|Yemen|Zambia|Zimbabwe'
    territories = territories_str.split('|')

    for territory in territories:
        territory_search = server.eval("@SOBJECT(twog/territory['name', '{0}'])".format(territory))

        if not territory_search:
            # Territory does not exist yet, insert it
            server.insert('twog/territory', {'name': territory})
    def get(self):
        parser = reqparse.RequestParser()
        parser.add_argument('token', required=True)
        args = parser.parse_args()

        ticket = args.get('token')

        server = TacticServerStub(server=url, project=project, ticket=ticket)

        element_evaluations = server.eval("@SOBJECT(twog/element_evaluation)")

        return jsonify({'element_evaluations': element_evaluations})
    def get(self):
        parser = reqparse.RequestParser()
        parser.add_argument('token', required=True)
        args = parser.parse_args()

        ticket = args.get('token')

        server = TacticServerStub(server=url, project=project, ticket=ticket)

        element_evaluations = server.eval("@SOBJECT(twog/element_evaluation)")

        return jsonify({'element_evaluations': element_evaluations})
    def get(self, name):
        parser = reqparse.RequestParser()
        parser.add_argument('token', required=True)
        args = parser.parse_args()

        ticket = args.get('token')

        server = TacticServerStub(server=url, project=project, ticket=ticket)

        element_evaluations = server.eval("@SOBJECT(twog/element_evaluation['name', '{0}'])".format(name))

        if element_evaluations:
            return jsonify({'exists': True})
        else:
            return jsonify({'exists': False})
    def get(self, name):
        parser = reqparse.RequestParser()
        parser.add_argument('token', required=True)
        args = parser.parse_args()

        ticket = args.get('token')

        server = TacticServerStub(server=url, project=project, ticket=ticket)

        element_evaluations = server.eval(
            "@SOBJECT(twog/element_evaluation['name', '{0}'])".format(name))

        if element_evaluations:
            return jsonify({'exists': True})
        else:
            return jsonify({'exists': False})
sys.path.append("//Art-1405260002/d/assets/client")

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)

import socket
tactic_server_ip = socket.gethostbyname("vg.com")
server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")
# ticket = "8cc245264e73d48685ded14b6aa431a7" #perpetual ticket?
server.set_ticket(ticket)

game_code = "GAME0070"
expr = "@SOBJECT(simpleslot/package['game_code','" + game_code + "'])"
game = server.eval(expr)
game_pkg_sk = game[0].get("__search_key__")
game_pkg_code = game[0].get("code")

expr = "@SOBJECT(sthpw/task['search_code','" + game_pkg_code + "'])"
tasks = server.eval(expr)

newlist = []
keyorder = [
    'layout', 'demo', 'output', 'pkg_flash', 'pkg_unity', 'web', 'banner', 'qc'
]
newlist = sorted(tasks,
                 key=lambda i: keyorder.index(i['process']),
                 reverse=True)

for task in newlist:
Beispiel #9
0
import sys
sys.path.append("//Art-1405260002/d/assets/client")

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
server.set_server("192.168.201.10")
#server.set_server("192.168.200.110")
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")
# ticket = "8cc245264e73d48685ded14b6aa431a7" #perpetual ticket?
server.set_ticket(ticket)

game_code = "GAME00020"
expr = "@SOBJECT(simpleslot/package['game_code','" + game_code + "'])"
game = server.eval(expr)
game_pkg_sk = game[0].get("__search_key__")

print game_pkg_sk
class ExpressionApiTest(unittest.TestCase):

    def setUp(self):
        pass

    def test_all(self):

        self.server = TacticServerStub()
        project_code = "unittest"
        self.server.set_project(project_code)

        self.server.start("Expression Test")
        try:
            self._setup()


            self._test_expression()

        except:
            self.server.abort()
            raise
        else:
            self.server.abort()


    def _setup(self):

        city_data = {
            'code': 'los_angeles'
        }

        search_type = "unittest/person"
        self.persons = []
        for i in range(0,4):
            data = {
                'name_first': 'person%s' % i,
                'name_last': 'Test',
                'city_code': 'los_angeles',
                'age': '25'
            }
            person = self.server.insert(search_type, data)
            self.persons.append( person )


    def _test_expression(self):

        # get the people sobjects
        expr = "@SOBJECT(unittest/person)"
        result = self.server.eval(expr)
        self.assertEquals(4, len(result))
        self.assertEquals("los_angeles", result[0].get("city_code") )

        # get a single person
        expr = "@SOBJECT(unittest/person)"
        result = self.server.eval(expr, single=True)
        self.assertEquals("los_angeles", result.get('city_code'))

        # get the first_name
        expr = "@GET(unittest/person.name_first)"
        names = self.server.eval(expr)
        self.assertEquals(len(names), 4)
        #self.assertEquals("person0", names[0])
        #self.assertEquals("person1", names[1])
 
 
        # count the number of people
        expr = "@COUNT(unittest/person)"
        count = self.server.eval(expr)
        self.assertEquals(4, count)

        # get the age of a person
        expr = "@GET(unittest/person.age)"
        age = self.server.eval(expr, self.persons[0], single=True)
        self.assertEquals(25, age)

      
        return
Beispiel #11
0
try:
    tactic_server_ip = socket.gethostbyname("vg.com")
except:
    tactic_server_ip = "192.168.163.60"

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")

server.set_ticket(ticket)
#%%
     
expr = "@SOBJECT(sthpw/task['assigned','steve_ho'])"
temp = server.eval(expr)


#%%

print len(temp)

for x in temp:
    print x['bid_start_date']
#%%
names = ""
bsd = ""
bed = names_chn = games_type = assigned = ""
for x in temp: #range(0,len(temp)):
    names = names + x.get('name')
    bsd = bsd + x.get('login')
Beispiel #12
0
import sys
sys.path.append("//Art-1405260002/d/assets/client")

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
server.set_server("192.168.200.60")
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")

server.set_ticket(ticket)


a = ['key', 'duke', 'samurai', 'joey_chen', 'una_wang', 'alpha', 'chihjung']
b = ['xeno_lee','dave', 'ison_lee', 'kenny_hou', 'mask_chang', 'michael922', 'tong', 'yi_lun']
c = a + b


for x in c:
    filters = filters +  "[\'login\',\'" + x + "\']"

expr = "@SOBJECT(sthpw/login['begin']['login','julio']['login','alpha']['or'])"
expr =  "@SOBJECT(sthpw/login['begin']" + filters + "['or'])"
test = server.eval(expr)

@SOBJECT(sthpw/login['begin']['login','yi_lun']['login','key']['login','duke']['login','samurai']['login','joey_chen']['login','una_wang']['login','alpha']['login','chihjung']['login','xeno_lee']['login','dave']['login','ison_lee']['login','kenny_hou']['login','mask_chang']['login','michael922']['login','tong']['login','yi_lun']['login','key']['login','duke']['login','samurai']['login','joey_chen']['login','una_wang']['login','alpha']['login','chihjung']['login','xeno_lee']['login','dave']['login','ison_lee']['login','kenny_hou']['login','mask_chang']['login','michael922']['login','tong']['login','yi_lun']['or'])
tactic_server_ip = socket.gethostbyname(socket.gethostname())

server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket("julio", "1234")
server.set_ticket(ticket)

import datetime
import calendar
import dateutil.parser
from datetime import timedelta
from dateutil import relativedelta

expr = "@SOBJECT(simpleslot/game['begin']['project_status','.In Progress']['project_status','.Complete']['or'])"
#expr = "@SOBJECT(simpleslot/game['project_status','.In Progress'])"
games = server.eval(expr)

expr = "@SOBJECT(simpleslot/task_combine)"
task_combine = server.eval(expr)

task_combine_sk = "simpleslot/task_combine"

data = {}
inlist = []
casino_processes = [
    "rough", "concept", "model", "texture", "effects", "rigging", "animation",
    "lighting", "layout", "final"
]
asset_processes = ["concept", "model", "texture", "rigging"]
shot_processes = ["layout", "animation", "effects", "lighting", "final"]
temp_min = []
Beispiel #14
0
import sys
sys.path.append("//Art-1405260002/d/assets/client")

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
server.set_server("192.168.201.10")
#server.set_server("192.168.200.110")
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")
# ticket = "8cc245264e73d48685ded14b6aa431a7" #perpetual ticket?
server.set_ticket(ticket)

expr = "@SOBJECT(simpleslot/game.sthpw/task['process','2d'])"
game_tasks = server.eval(expr)

for task in game_tasks:
    status = task.get("status")
    game_code = task.get("search_code")
    print game_code
Beispiel #15
0
class ExpressionApiTest(unittest.TestCase):
    def setUp(self):
        pass

    def test_all(self):

        self.server = TacticServerStub()
        project_code = "unittest"
        self.server.set_project(project_code)

        self.server.start("Expression Test")
        try:
            self._setup()

            self._test_expression()

        except:
            self.server.abort()
            raise
        else:
            self.server.abort()

    def _setup(self):

        city_data = {'code': 'los_angeles'}

        search_type = "unittest/person"
        self.persons = []
        for i in range(0, 4):
            data = {
                'name_first': 'person%s' % i,
                'name_last': 'Test',
                'city_code': 'los_angeles',
                'age': '25'
            }
            person = self.server.insert(search_type, data)
            self.persons.append(person)

    def _test_expression(self):

        # get the people sobjects
        expr = "@SOBJECT(unittest/person)"
        result = self.server.eval(expr)
        self.assertEquals(4, len(result))
        self.assertEquals("los_angeles", result[0].get("city_code"))

        # get a single person
        expr = "@SOBJECT(unittest/person)"
        result = self.server.eval(expr, single=True)
        self.assertEquals("los_angeles", result.get('city_code'))

        # get the first_name
        expr = "@GET(unittest/person.name_first)"
        names = self.server.eval(expr)
        self.assertEquals(len(names), 4)
        #self.assertEquals("person0", names[0])
        #self.assertEquals("person1", names[1])

        # count the number of people
        expr = "@COUNT(unittest/person)"
        count = self.server.eval(expr)
        self.assertEquals(4, count)

        # get the age of a person
        expr = "@GET(unittest/person.age)"
        age = self.server.eval(expr, self.persons[0], single=True)
        self.assertEquals(25, age)

        return
import sys
sys.path.append("//Art-1405260002/d/assets/client")

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
server.set_server("192.168.201.10")
#server.set_server("192.168.200.110")
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")
server.set_ticket(ticket)

expr = "@SOBJECT(sthpw/login)"
logins = server.eval(expr)
#logins = ['fish_hung', 'alpha']
#6965 = shot
#6270 = asset
#6264 = casino

widget_template_id = 6264

expr = "@SOBJECT(sthpw/wdg_settings['id','" + str(widget_template_id) + "'])"
widget_template = server.eval(expr)[0]

wkey = widget_template.get("key")
wlogin = widget_template.get("login")
wdata = widget_template.get("data")
wproject_code = widget_template.get("project_code")

expr = "@GET(sthpw/wdg_settings['key','" + wkey + "'].login)"
existing_login = server.eval(expr)
Beispiel #17
0
tasks = server.eval(expr)
test = []
for task in tasks:
    sk = task.get("__search_key__")
    process = "pkg_flash"
    data = {'process': process}
    server.update(sk, data)
print test
expr = "@SOBJECT(sthpw/note['search_type','simpleslot/package?project=simpleslot'])"
notes = server.eval(expr)
test = []
for note in notes:
    sk = note.get("__search_key__")
    search_code = note.get("search_code")
    search_code = search_code.replace("2D","PACKAGE")
    data = {'search_code': search_code}
    server.update(sk, data)
'''
expr = "@SOBJECT(sthpw/file['search_type','simpleslot/package?project=simpleslot'])"
snapshots = server.eval(expr)
test = []
for snapshot in snapshots:
    sk = snapshot.get("__search_key__")
    search_code = snapshot.get("search_code")
    if search_code[:2] == "2D":
        search_code = search_code.replace("2D", "PACKAGE")
        test.append(search_code)
        data = {'search_code': search_code}
        server.update(sk, data)
print test
Beispiel #18
0
server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket("julio", "1234")
server.set_ticket(ticket)

skype = Skype4Py.Skype()
client = skype.Client
if not client.IsRunning:
    client.Start()
skype = Skype4Py.Skype()
skype.Attach()

now = datetime.datetime.now()
today_string = str(now.year) + "-" + str(now.month) + "-" + str(now.day)
expr = "@SOBJECT(simpleslot/daily_duty_schedule['day','" + today_string + "'])"
duty = server.eval(expr)

for d in duty:
    worker1 = d.get("name").split(",")[1].replace(" ", "")
    worker2 = d.get("name1").split(",")[1].replace(" ", "")
    expr = "@SOBJECT(sthpw/login['begin']['login','" + worker1 + "']['login','" + worker2 + "']['or'])"
    logins = server.eval(expr)

    for login in logins:
        name = login.get('login')
        if name == 'julio':
            pass
        else:
            skypename = login.get('skype')
            final = today_string + "\n" + worker1 + "跟".decode(
                'utf-8') + worker2 + "是今天值日生,請:".decode(
Beispiel #19
0
if os.path.isfile(ticket_file) is False:
    with open(ticket_file, 'w') as file_object:
        ticket_content = "login="******"\n" + "server=" + tactic_server_ip + "\n" + "project=simpleslot"
        file_object.write(ticket_content)

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)

server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket(name, password)
server.set_ticket(ticket)

expr= "@SOBJECT(sthpw/login)"
logins = server.eval(expr)

expr = "@GET(sthpw/login.login)"
names = server.eval(expr)

filepath = "c:\loginList.txt"

with open(filepath,"w") as datafile:
    for x in logins:
        datafile.write(str(x) + "\n")
        
with open(filepath, "wb") as datafile:
    pickle.dump(logins, datafile, pickle.HIGHEST_PROTOCOL)
        

Beispiel #20
0
def saveVrayVFB():
    username = os.environ.get("USERNAME")
    from tactic_client_lib import TacticServerStub
    server = TacticServerStub()
    #server.set_server("192.168.201.10")
    #server.set_project("simpleslot")
    ticket_files = os.listdir("c:/sthpw/etc/")
    ticket_file = "c:/sthpw/etc/" + username + ".tacticrc"

    if len(ticket_files) == 0:
        file_object = open(ticket_file, "w")
        ticket_content = "login="******"\n" + "server=192.168.201.10" + "\n" + "project=simpleslot"
        file_object.write(ticket_content)
        file_object.close()

    else:
        file_object = open(ticket_file)
        ticket_content = file_object.readlines()
        file_object.close()
        ticket = ticket_content[2].replace("ticket=", "").replace("\n", "")
        server.ticket = ticket
        server.set_server("192.168.201.10")
        server.set_project("simpleslot")

    rvname = jc.getNextFileName(1)

    rv_path = rvname[0]
    rv_filename = rvname[2]
    # base_scenename = rvname[1].

    project_name = rvname[3][0]
    item_name = rvname[3][1]
    process = rvname[3][2]
    # author = rvname[3][3]
    # reviewVersion = rvname[3][4]
    project_type = rvname[3][5]
    item_type = rvname[3][6]

    if project_type == "casino":
        stype = "3d"
    elif project_type == "assets":
        stype = "assets"
    elif project_type == "shot":
        stype = "shot"

    tactic_base_path = "//Art-1405260002/d/assets/simpleslot/"

    src_filename = rv_path + rv_filename
    dst_filename = tactic_base_path + project_name + "/" + project_type + "/" + process + "/" + rv_filename

    if os.path.isdir(tactic_base_path + project_name + "/" + project_type +
                     "/" + process + "/") is False:
        os.makedirs(tactic_base_path + project_name + "/" + project_type +
                    "/" + process + "/")

    cmd = "vfbControl #saveImage \"" + src_filename + ".exr\""
    MaxPlus.Core.EvalMAXScript(cmd)

    imageMagickCMD = "//Art-1405260002/d/assets/scripts/ImageMagick-6.9.0-6/convert.exe -quality 100 -colorspace RGB \"%s\" -colorspace sRGB \"%s\"" % (
        src_filename + ".exr", src_filename + ".jpg")
    subprocess.call(imageMagickCMD)

    # deleteEXRCMD = "del \"" + src_filename + ".exr\""
    # deleteEXRCMD = deleteEXRCMD.replace("/","\\")
    # subprocess.call(deleteEXRCMD)
    os.remove(src_filename + ".exr")

    shutil.copy2((src_filename + ".jpg"), (dst_filename + ".jpg"))

    expr = "@SOBJECT(simpleslot/game['name','" + project_name + "'].simpleslot/" + stype + "['name','" + item_name + "'].sthpw/task['process','" + process + "'])"
    task = server.eval(expr)

    sk = task[0].get("__search_key__")

    final_filename = "/mnt/hgfs/assets/simpleslot/" + project_name + "/" + project_type + "/" + process + "/" + rv_filename + ".jpg"

    server.simple_checkin(sk,
                          process,
                          final_filename,
                          description="VRAY",
                          mode="inplace")
    print "image uploaded"
Beispiel #21
0
def saveRV():
    username = os.environ.get("USERNAME")
    from tactic_client_lib import TacticServerStub
    server = TacticServerStub()
    #server.set_server("192.168.201.10")
    #server.set_project("simpleslot")
    ticket_files = os.listdir("c:/sthpw/etc/")
    ticket_file = "c:/sthpw/etc/" + username + ".tacticrc"

    if len(ticket_files) == 0:
        file_object = open(ticket_file, "w")
        ticket_content = "login="******"\n" + "server=192.168.201.10" + "\n" + "project=simpleslot"
        file_object.write(ticket_content)
        file_object.close()

    else:
        file_object = open(ticket_file)
        ticket_content = file_object.readlines()
        file_object.close()
        ticket = ticket_content[2].replace("ticket=", "").replace("\n", "")
        server.ticket = ticket
        server.set_server("192.168.201.10")
        server.set_project("simpleslot")

    rvname = jc.getNextFileName(1)
    rv_path = rvname[0]
    rv_filename = rvname[2]
    # base_scenename = rvname[1].

    project_name = rvname[3][0]
    item_name = rvname[3][1]
    process = rvname[3][2]
    # author = rvname[3][3]
    # reviewVersion = rvname[3][4]
    project_type = rvname[3][5]
    tactic_base_path = "//Art-1405260002/d/assets/simpleslot/"

    if project_type == "casino":
        stype = "3d"
    elif project_type == "assets":
        stype = "assets"
    elif project_type == "shot":
        stype = "shot"

    src_filename = rv_path + rv_filename
    dst_filename = tactic_base_path + project_name + "/" + project_type + "/" + process + "/" + rv_filename

    if os.path.isdir(tactic_base_path + project_name + "/" + project_type +
                     "/" + process + "/") is False:
        os.makedirs(tactic_base_path + project_name + "/" + project_type +
                    "/" + process + "/")

    if cmds.intScrollBar("scrollBar", q=1, v=1) == -1:
        cmds.renderWindowEditor("renderView", e=1, si=1)
        cmds.intScrollBar("scrollBar", e=1, v=0)

    orig_format = mel.eval('getAttr "defaultRenderGlobals.imageFormat";')
    mel.eval('setAttr "defaultRenderGlobals.imageFormat" 8;')
    cmds.renderWindowEditor("renderView", e=1, wi=src_filename)
    mel.eval('setAttr "defaultRenderGlobals.imageFormat" ' + str(orig_format) +
             ';')

    shutil.copy2((src_filename + ".jpg"), (dst_filename + ".jpg"))

    expr = "@SOBJECT(simpleslot/game['name','" + project_name + "'].simpleslot/" + stype + "['name','" + item_name + "'].sthpw/task['process','" + process + "'])"
    task = server.eval(expr)

    sk = task[0].get("__search_key__")

    final_filename = "/mnt/hgfs/assets/simpleslot/" + project_name + "/" + project_type + "/" + process + "/" + rv_filename + ".jpg"

    server.simple_checkin(sk,
                          process,
                          final_filename,
                          description="image",
                          mode="inplace")
    print "image uploaded"


#saveRV()
Beispiel #22
0
from tactic_client_lib import TacticServerStub
server = TacticServerStub()

server.set_server("192.168.201.10")
server.set_project("simpleslot")
ticket = server.get_ticket("julio", "1234")
server.set_ticket(ticket)

import Skype4Py

skype = Skype4Py.Skype()
client = skype.Client
if not client.IsRunning:
    client.Start()
skype.Attach()

expr = "@GET(sthpw/login['begin']['department','sound']['department','producers']['or'].skype)"
names = server.eval(expr)

buddies = skype.Friends

buddylist = [x.Handle for x in buddies]

for name in names:
    if name not in buddylist:
        print name

        client.OpenAddContactDialog(name)
        time.sleep(5)
Beispiel #23
0
sys.path.append("//Art-1405260002/d/assets/client")
import datetime
from dateutil import parser

from tactic_client_lib import TacticServerStub
server = TacticServerStub(setup=False)
import socket
tactic_server_ip = socket.gethostbyname("vg.com")
server.set_server(tactic_server_ip)
server.set_project("simpleslot")
ticket = server.get_ticket("admin", "chicago")
server.set_ticket(ticket)

#['name','combine_cf']
expr = "@SOBJECT(simpleslot/game)"
games = server.eval(expr)

test = []
for game in games:
    sk = game.get("__search_key__")
    code = game.get("code")
    name = game.get("name")
    print name

    expr = "@MAX(simpleslot/game['code','" + code + "'].sthpw/task.bid_end_date)"
    try:
        bed = server.eval(expr)
        bed = parser.parse(bed)
        
   
        if bed.month >= 1 and bed.month <= 3:
Beispiel #24
0
skype = Skype4Py.Skype()
client = skype.Client
if not client.IsRunning:
    client.Start()
skype = Skype4Py.Skype()
skype.Attach()

all_messages = []
departments = ['2d', '3d', 'technical_artist', 'sound']
dept_string = ""
for dept in departments:
    dept_string = dept_string + "['department','" + dept + "']"

expr = "@SOBJECT(sthpw/login['begin']" + dept_string + "['or'])"
logins = server.eval(expr)

for login in logins:

    name = login.get('login')
    skypeName = login.get('skype')

    expr = "@SOBJECT(sthpw/task['begin']['status','.In Progress']['status','.Ready']['or']['assigned','" + name + "'])"
    all_tasks = server.eval(expr)
    count = 0
    temp = []
    game_name = task_name = final = ""
    notification = '這是TACTIC系統工作自動提示\n完成的工作請把狀況設成 Review\n請登入TACTIC > 個人工作管理\n這是系統自動訊息, 請勿回復\n'
    #notification = '2015/4/9 系統測試\n'
    print skypeName
    for task in all_tasks: