示例#1
0
 def __init__(self, name, parent=None, comment=None):
     """
     Each class must have a name and might have a parent.  If a manifest
     has a parent, this signals it to `include` itself in the parent.
     """
     self.name, count = re.subn(r'\.', '--', unicode(name))
     self.parent = parent
     self.comment = comment
     self.manifests = defaultdict(dict)
     self.defaults = {}
     self.resources = defaultdict(dict)
     self.deps = []
示例#2
0
 def __init__(self, name, parent=None, comment=None):
     """
     Each class must have a name and might have a parent.  If a manifest
     has a parent, this signals it to `include` itself in the parent.
     """
     self.name, count = re.subn(r'\.', '--', unicode(name))
     self.parent = parent
     self.comment = comment
     self.manifests = defaultdict(dict)
     self.defaults = {}
     self.resources = defaultdict(dict)
     self.deps = []
示例#3
0
    def __init__(self, match, player_id, grid_scale):
        # definitions
        self.match = match
        self.player_id = player_id
        self.grid_scale = grid_scale

        # load at startup
        self.player_colors = {}
        self.loaded_images = {}
        self.unit_images = defaultdict(dict)
        self.energy_images = defaultdict(dict)

        # runtime_changes
        self.unit_sprites = {}
        self.energy_sprites = {}
        self.unit_batch = pyglet.graphics.Batch()
        self.energy_batch = pyglet.graphics.Batch()

        for player in match.players:
            self.player_colors[player.player_id] = player.color
            for unit_type in match.unit_data:
                unit_settings = match.unit_data[unit_type]
                if unit_settings.images in self.loaded_images:
                    image = self.loaded_images[unit_settings.images["body"]]
                else:
                    image = pyglet.resources.image(unit_settings.images)
                    self.loaded_images[unit_settings.images] = image

                self.unit_images[player.player_id][unit_type] = TextureGrid(
                    ImageGrid(image, len(Color), 1))[player.color]
        for unit_type in match.unit_data:
            # todo: energy images load
            unit_settings = match.unit_data[unit_type]
            image = pyglet.resources.image(unit_esttings.images["energy"])
            self.energy_images[unit_type] = TextureGrid(
                ImageGrid(image, 1, unit_settings.max_energy))
            pass
示例#4
0
 def sources(self):
     if 'sources' not in self:
         self['sources'] = defaultdict(dict)
     return self['sources']
示例#5
0
 def packages(self):
     if 'packages' not in self:
         self['packages'] = defaultdict(lambda: defaultdict(list))
     return self['packages']
示例#6
0
 def files(self):
     if 'files' not in self:
         self['files'] = defaultdict(dict)
     return self['files']
示例#7
0
from defaultdict import defaultdict

metaqueries = defaultdict(defaultdict)

metaqueries['desc']['oracle'] = defaultdict(defaultdict)
metaqueries['desc']['oracle']['TABLE']['long'] = (
"""SELECT atc.column_id "#",
atc.column_name,
CASE atc.nullable WHEN 'Y' THEN 'NULL' ELSE 'NOT NULL' END "Null?",
atc.data_type ||
CASE atc.data_type WHEN 'DATE' THEN ''
ELSE '(' ||
CASE atc.data_type WHEN 'NUMBER' THEN TO_CHAR(atc.data_precision) ||
CASE atc.data_scale WHEN 0 THEN ''
ELSE ',' || TO_CHAR(atc.data_scale) END
ELSE TO_CHAR(atc.data_length) END 
END ||
CASE atc.data_type WHEN 'DATE' THEN '' ELSE ')' END
data_type,
acc.comments
FROM all_tab_columns atc
JOIN all_col_comments acc ON (acc.owner = atc.owner AND acc.table_name = atc.table_name AND acc.column_name = atc.column_name)
WHERE atc.table_name = :object_name
AND      atc.owner = :owner
ORDER BY atc.column_id;""",)

metaqueries['desc']['oracle']['TABLE']['short'] = (
"""SELECT atc.column_name,
CASE atc.nullable WHEN 'Y' THEN 'NULL' ELSE 'NOT NULL' END "Null?",
atc.data_type ||
CASE atc.data_type WHEN 'DATE' THEN ''
示例#8
0
 def sources(self):
     if 'sources' not in self:
         self['sources'] = defaultdict(dict)
     return self['sources']
示例#9
0
 def packages(self):
     if 'packages' not in self:
         self['packages'] = defaultdict(lambda: defaultdict(list))
     return self['packages']
示例#10
0
 def files(self):
     if 'files' not in self:
         self['files'] = defaultdict(dict)
     return self['files']