def exportSkills(self, cursor):
   print("Exporting skills...")
   starttime = time()
   cursor.execute("SELECT name FROM skill")
   primary_keys = set([ i[0] for i in cursor.fetchall() ])
   cursor.executemany(
     '''insert into skill (name,source,lastmodified) values(%s,%s,%s)''',
     [
       ( i.name, i.source, self.timestamp )
       for i in frepple.skills()
       if i.name not in primary_keys and (not self.source or self.source == i.source)
     ])
   cursor.executemany(
     '''update skill set source=%s, lastmodified=%s where name=%s''',
     [
       (i.source, self.timestamp, i.name)
       for i in frepple.skills()
       if i.name not in primary_keys and (not self.source or self.source == i.source)
     ])
   print('Exported skills in %.2f seconds' % (time() - starttime))
示例#2
0
 def exportSkills(self, cursor):
   with transaction.atomic(using=self.database, savepoint=False):
     print("Exporting skills...")
     starttime = time()
     cursor.execute("SELECT name FROM skill")
     primary_keys = set([ i[0] for i in cursor.fetchall() ])
     cursor.executemany(
       '''insert into skill (name,source,lastmodified) values(%s,%s,%s)''',
       [
         ( i.name, i.source, self.timestamp )
         for i in frepple.skills()
         if i.name not in primary_keys and (not self.source or self.source == i.source)
       ])
     cursor.executemany(
       '''update skill set source=%s, lastmodified=%s where name=%s''',
       [
         (i.source, self.timestamp, i.name)
         for i in frepple.skills()
         if i.name not in primary_keys and (not self.source or self.source == i.source)
       ])
     print('Exported skills in %.2f seconds' % (time() - starttime))
def exportSkills(cursor):
  print("Exporting skills...")
  starttime = time()
  cursor.execute("SELECT name FROM skill")
  primary_keys = set([ i[0] for i in cursor.fetchall() ])
  cursor.executemany(
    '''insert into skill (name,lastmodified) values(%s,%s)''',
    [( i.name, timestamp ) for i in frepple.skills()
     if i.name not in primary_keys
    ])
  transaction.commit(using=database)
  print('Exported skills in %.2f seconds' % (time() - starttime))
示例#4
0
 def exportSkills(self, cursor):
   with transaction.atomic(using=self.database, savepoint=False):
     print("Exporting skills...")
     starttime = time()
     cursor.execute("SELECT name FROM skill")
     primary_keys = set([ i[0] for i in cursor.fetchall() ])
     cursor.executemany(
       "insert into skill (name,source,lastmodified) values(%s,%s,%s)",
       [
         ( i.name, i.source, self.timestamp )
         for i in frepple.skills()
         if i.name not in primary_keys and (not self.source or self.source == i.source)
       ])
     cursor.executemany(
       "update skill set source=%s, lastmodified=%s where name=%s",
       [
         (i.source, self.timestamp, i.name)
         for i in frepple.skills()
         if i.name in primary_keys and (not self.source or self.source == i.source)
       ])
     print('Exported skills in %.2f seconds' % (time() - starttime))
def exportSkills(cursor):
  print("Exporting skills...")
  starttime = time()
  cursor.execute("SELECT name FROM skill")
  primary_keys = set([ i[0] for i in cursor.fetchall() ])
  cursor.executemany(
    '''insert into skill (name,lastmodified) values(%s,%s)''',
    [( i.name, timestamp ) for i in frepple.skills()
     if i.name not in primary_keys
    ])
  transaction.commit(using=database)
  print('Exported skills in %.2f seconds' % (time() - starttime))
示例#6
0
 def res_skills():
   for s in frepple.skills():
     for r in s.resources:
       yield (r.effective_start, r.effective_end, r.priority, r.source, self.timestamp, r.name, s.name)