Exemplo n.º 1
0
sys.setdefaultencoding('utf8')

from sys import argv

try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET

import urllib2
import mysql.connector
#from mysql.connector import connection
from gamelist import create_gamelist
#from categorylist import *

name_dict = create_gamelist()

schema_name = 'boardgames'
table_name = 'bggdata'
"""
try:
    environment = argv[1]
Exception:
    print 'usage: python bggapi.py local|remote'
"""
try:
    gameid = argv[1]
    if gameid[0:2] != '99':
        print 'gameid should start with 99, example 991234'
        sys.exit(0)
except:
Exemplo n.º 2
0
import codecs
import json

try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET

#import urllib2
import mysql.connector
#from mysql.connector import connection

from gamelist import create_gamelist
from categorylist import *

nameCN_dict = create_gamelist()

designer_dict = dict()
designer_dict['Reiner Knizia'] = u'倪睿南'
designer_dict['Chu-Lan Kao'] = u'高竹岚'
designer_dict['Uwe Rosenberg'] = u'乌老师'
designer_dict['Liu Xiao'] = u'刘啸'

type_dict = create_typelist()
category_dict = create_categorylist()
mechanic_dict = create_mechaniclist()

#print nameCN_dict
schema_name = 'boardgames'
table_name_src = 'bggdata'
#table_name_dst = 'raw_text_table'
Exemplo n.º 3
0
import os
import sys


from sys import argv

import PIL
from PIL import Image
from exceptions import IOError
img_home = os.getenv('IMG_HOME')
slash = '/'

from gamelist import create_gamelist

nameCN_list = create_gamelist()
game_list = nameCN_list

try:
    gameid = argv[1]
    game_list = nameCN_list[gameid]
    from_postfix = 'JPG'
    to_postfix = 'jpg'
except:
    from_postfix = 'JPG'
    to_postfix = 'jpg'
    print 'doing jpg progressive for all pics'
    #print "usage: python change_postfix.py gameid"
    #sys.exit(0)

for gameid in game_list.keys():
    #change name