本文整理汇总了Python中MOSES.getWritersList方法的典型用法代码示例。如果您正苦于以下问题:Python MOSES.getWritersList方法的具体用法?Python MOSES.getWritersList怎么用?Python MOSES.getWritersList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOSES
的用法示例。
在下文中一共展示了MOSES.getWritersList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: populateWriters
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getWritersList [as 别名]
def populateWriters(self):
self.writers_filter_box.clear()
start_date = self.start_date_edit.date().toPyDate()
end_date = self.end_date_edit.date().toPyDate()
self.writers_list = MOSES.getWritersList(self.user_id, self.password, start_date)
writers = list(set(self.writers_list["Name"]))
writers.sort()
self.writers_filter_box.addItems(writers)
示例2: summarize
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getWritersList [as 别名]
def summarize(self):
"""
1. Get the list of all writers working on the start_date.
2. For each writer,
2.1 If the dates are different, get the average efficiency between the two dates.
2.2 get the efficiency on the end_date.
2.4 get the efficiency on the week of the end_date.
2.5 get the effiency on the month of the end_date.
2.6 get the efficiency on the quarter.
2.7 get the effiency on the half-year.
3. Build all this information into a dictionary.
4. Compile all dictionaries into a list.
5. Emit the list.
"""
self.writers = MOSES.getWritersList(self.user_id, self.password, self.start_date)
self.summary_data = []
done = 0
total = len(self.writers)
self.break_loop = False
finished_all_writers = False
start_time = datetime.datetime.now()
for writer in self.writers:
self.writer_id = writer["Employee ID"]
self.writer_name = writer["Name"]
self.writer_email = writer["Email ID"]
try:
writer_summary = self.fetchWriterSummary()
except Exception, err:
print "********\nEncountered an error while trying to fetch data for the summary sheet in PorkKent.\nPrinting the error:\n%s\n********" % repr(err)
pass
time.sleep(5)
try:
writer_summary = self.fetchWriterSummary(1)
except Exception, err:
print "********\nEncountered an error while trying to fetch data for the summary sheet in PorkKent.\nPrinting the error:\n%s\n********" % repr(err)
pass
time.sleep(5)
try:
writer_summary = self.fetchWriterSummary(2)
except Exception, err:
print "********\nEncountered an error while trying to fetch data for the summary sheet in PorkKent.\nPrinting the error:\n%s\n********" % repr(err)
pass
time.sleep(5)
try:
writer_summary = self.fetchWriterSummary(3)
except Exception, err:
print "********\nEncountered an error while trying to fetch data for the summary sheet in PorkKent.\nPrinting the error:\n%s\n********" % repr(err)
raise
示例3: getEfficiencyData
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getWritersList [as 别名]
def getEfficiencyData(query_date=None):
#Set the date.
if query_date is None:
query_date = datetime.date.today()
user_id, password = MOSES.getbbc()
#Get a list of dictionaries pertaining to writers' data.
writers_data_list = MOSES.getWritersList(user_id, password, query_date)
#get a sorted list of writers' employee IDs.
writers_ids = [writer["Employee ID"] for writer in writers_data_list]
writers_ids.sort()
writer_count = len(writers_ids)
#For each writer, get the efficiency, work status, cfm and gseo.
writer_data_frame = pd.DataFrame(columns=["Employee ID","Employee Name","Status","Efficiency","CFM","GSEO","Efficiency Color","CFM Color", "GSEO Color"] )
#create a pandas dataframe with the following columns:
#writerid, writer_name, work_status, efficiency, cfm, gseo, stack_rank_index
red = "#FF3325"
green = "#43AD38"
blue = "#027CD5"
bright_blue = "#027CD5"
grey = "0.75"
writer_counter = 0
for writer in writers_data_list:
writer_id = writer["Employee ID"]
writer_name = "%s" %writer["Name"][:writer["Name"].find(" ")]
status, relaxation, approval = MOSES.checkWorkStatus(user_id, password, query_date, writer_id)
if status == "Working":
efficiency = MOSES.getEfficiencyFor(user_id, password, query_date, writer_id)
else:
efficiency = 100.00
cfm = MOSES.getCFMFor(user_id, password, query_date, writer_id)
gseo = MOSES.getGSEOFor(user_id, password, query_date, writer_id)
if status == "Working":
efficiency *= 100.000
efficiency = np.around(efficiency,3)
if efficiency < 100.000:
efficiency_color = red
elif 100.000 <= efficiency < 105.000:
efficiency_color = green
elif 105.000 <= efficiency < 110.000:
efficiency_color = blue
else:
efficiency_color = bright_blue
else:
efficiency_color = grey
#print efficiency, efficiency_color
if cfm < 95.000:
cfm_color = red
elif 95.000 <= cfm < 97.000:
cfm_color = green
elif 97.000 <= cfm < 99.000:
cfm_color = blue
else:
cfm_color = bright_blue
if gseo < 95.000:
gseo_color = red
elif 95.000 <= gseo < 97.000:
gseo_color = green
elif 97.000 <= gseo < 99.000:
gseo_color = blue
else:
gseo_color = bright_blue
writer_array = [writer_id, writer_name, status, efficiency,
cfm, gseo, efficiency_color, cfm_color, gseo_color]
#print writer_array
writer_data_frame.loc[writer_counter] = writer_array
writer_counter+=1
writer_data_frame.sort(["Efficiency","CFM","GSEO"], ascending = [0,0,0], inplace = True)
return writer_data_frame
示例4: getWritersList
# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getWritersList [as 别名]
def getWritersList(self):
self.writers_data_frame = MOSES.getWritersList(self.user_id, self.password, self.start_date_edit.date().toPyDate())
writer_names_list = list(set(self.writers_data_frame["Name"]))
writer_names_list.sort()
return writer_names_list