コード例 #1
0
ファイル: scopus.py プロジェクト: gapson/synapse-bibliography
 def _store_upload(self):
     # set the output file name to a standard name with a timestamp
     self.out_name = "/tmp/uploads/scopus_file_%s.csv" % datetime.datetime.isoformat(datetime.datetime.now())
     file_out = codecs.open(self.out_name, "wb", encoding='ascii', errors='replace')
     file_out.write(kill_gremlins(self.content))
     file_out.close()
     return None
コード例 #2
0
 def _store_upload(self):
     # set the output file name to a standard name with a timestamp
     self.out_name = "/tmp/uploads/emp_file_%s.csv" % datetime.datetime.isoformat(
         datetime.datetime.now())
     emp_file_out = codecs.open(self.out_name, "wb", 'ascii', 'replace')
     emp_file_out.write(kill_gremlins(self.content))
     emp_file_out.close()
     return None
コード例 #3
0
 def __init__(self, content, year):
     self.content = kill_gremlins(content)
     if year in ('BLANK', u'BLANK') or not year:
         self.year = datetime.datetime.now().year
     else:
         self.year = year
     self._store_upload()
     self.empids_in_csv = []
     self.empids_cc = []
     for row in self.get_reader():
         self.empids_in_csv.append(row['EMPLID'])
         self.empids_cc.append({'emp_id': row['EMPLID'], 'cost_center': row['DEPTID']})
     return None
コード例 #4
0
 def __init__(self, content, year):
     self.content = kill_gremlins(content)
     if year in ('BLANK', u'BLANK') or not year:
         self.year = datetime.datetime.now().year
     else:
         self.year = year
     self._store_upload()
     self.empids_in_csv = []
     self.empids_cc = []
     for row in self.get_reader():
         self.empids_in_csv.append(row['EMPLID'])
         self.empids_cc.append({
             'emp_id': row['EMPLID'],
             'cost_center': row['DEPTID']
         })
     return None