rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
return self.__search__()[0]['responseData']['cursor']['estimatedResultCount'] self.pages = temp
result_count = 0 try: result_count = self.__search__()[0]['responseData']['cursor']['estimatedResultCount'] except Exception,e: print e finally: self.pages = temp return result_count
def get_result_count(self): """Returns the number of results""" temp = self.pages self.pages = 1 return self.__search__()[0]['responseData']['cursor']['estimatedResultCount'] self.pages = temp
self.filter = 1 self.rsz = 'large' self.safe = 'off'
self.filter = FILTER_ON self.rsz = RSZ_LARGE self.safe = SAFE_OFF
def __init__(self,query,pages=10): self.pages = pages #Number of pages. default 10 self.query = query self.filter = 1 #Controls turning on or off the duplicate content filter. On = 1. self.rsz = 'large' #Results per page. small = 4 /large = 8 self.safe = 'off' #SafeBrowsing - ac...
'start' : page, 'rsz': RSZ_LARGE, 'safe' : SAFE_OFF, 'filter' : FILTER_ON,
'start' : page*rsz, 'rsz': self.rsz, 'safe' : self.safe, 'filter' : self.filter,
def __search__(self,print_results = False): results = [] for page in range(0,self.pages): args = {'q' : self.query, 'v' : '1.0', 'start' : page, 'rsz': RSZ_LARGE, 'safe' : SAFE_OFF, 'filter' : FILTER_ON, } q = urllib.urlencode(args) search_results = urllib.urlopen(URL+q) data = json.loads(search_results.read()) if prin...
for result in data['responseData']['results']: if result: print '[%s]'%(urllib.unquote(result['titleNoFormatting'])) print result['content'].strip("<b>...</b>").replace("<b>",'').replace("</b>",'').replace("& print urllib.unquote(result['unescapedUrl'])+'\n'
if data['responseStatus'] == 200: for result in data['responseData']['results']: if result: print '[%s]'%(urllib.unquote(result['titleNoFormatting'])) print result['content'].strip("<b>...</b>").replace("<b>",'').replace("</b>",'').replace("& print urllib.unquote(result['unescapedUrl'])+'\n'
def __search__(self,print_results = False): results = [] for page in range(0,self.pages): args = {'q' : self.query, 'v' : '1.0', 'start' : page, 'rsz': RSZ_LARGE, 'safe' : SAFE_OFF, 'filter' : FILTER_ON, } q = urllib.urlencode(args) search_results = urllib.urlopen(URL+q) data = json.loads(search_results.read()) if prin...
def search(self): """Returns a dict of Title/URLs""" results = {} for data in self.__search__(): for result in data['responseData']['results']: if result: title = urllib.unquote(result['titleNoFormatting']) results[title] = urllib.unquote(result['unescapedUrl']) return results
def search_page_wise(self): """Returns a dict of page-wise urls""" results = {} for page in range(0,self.pages): args = {'q' : self.query, 'v' : '1.0', 'start' : page, 'rsz': RSZ_LARGE, 'safe' : SAFE_OFF, 'filter' : FILTER_ON, } q = urllib.urlencode(args) search_results = urllib.urlopen(URL+q) data = json.loads(search_...
self.assertRaises(Exception, test_view('calendar'))
test_view('calendar')
def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('calendar'))
vevent.recurrence_id.value, datetime.time())
vevent.recurrence_id.value, datetime.time() ).replace(tzinfo=tzlocal)
def ical2values(self, cursor, user, event_id, ical, calendar_id, vevent=None, context=None): ''' Convert iCalendar to values for create or write
if occurence.recurrence.replace(tzinfo=tzlocal) \ == vevent.recurrence_id.value:
if vals['recurrence'] == \ occurence.recurrence.replace(tzinfo=tzlocal):
def ical2values(self, cursor, user, event_id, ical, calendar_id, vevent=None, context=None): ''' Convert iCalendar to values for create or write
vals = self.ical2values(cursor, user, event_id, ical, calendar_id, vevent=vevent, context=context)
def ical2values(self, cursor, user, event_id, ical, calendar_id, vevent=None, context=None): ''' Convert iCalendar to values for create or write
res['occurences'].append(('delete', occurences_todel))
res['occurences'].insert(0, ('delete', occurences_todel))
def ical2values(self, cursor, user, event_id, ical, calendar_id, vevent=None, context=None): ''' Convert iCalendar to values for create or write
self.drawing = drawing
def __init__(self, xmlfile, drawing): self.drawing = drawing
self.parse_path(str(attrs["d"]))
self.parse_path(str(attrs["d"]), str(attrs["id"]))
def startElement(self, name, attrs): #print "starting element", str(name) if str(name) == "path": self.parse_path(str(attrs["d"]))
return False def parse_path(self, dstring):
return False def parse_path(self, dstring, idstring):
def _loop_is_surrounded(self, loop): for other in (l for l in self.loops if l != loop): if other.surrounds(loop): return True return False
self.parse_mpath(dlist)
self.parse_mpath(dlist, idstring)
def parse_path(self, dstring): """parse 'd' attribute of path tag """ # split attr string on whitespace dlist = dstring.split() # parser for "m" (inkscape format) if dlist[0] == "m" or dlist[0] == "M": self.parse_mpath(dlist) return raise ValueError("unrecognized d attr init: {0}".format(dlist[0]))
def parse_mpath(self, dlist):
def parse_mpath(self, dlist, idstring):
def parse_mpath(self, dlist): """parse path from inkscape-style d attr list 'm x,y dx,dy dx,dy ... [z]' """ relative = True # discard initial m if dlist.pop(0) == "M": relative = False # loop to fill with vertices loop = Loop2()
loop = Loop2()
loop = Loop2(idstring)
def parse_mpath(self, dlist): """parse path from inkscape-style d attr list 'm x,y dx,dy dx,dy ... [z]' """ relative = True # discard initial m if dlist.pop(0) == "M": relative = False # loop to fill with vertices loop = Loop2()
raise ValueError("wtf? can't add pair to loop!")
raise ValueError( "wtf? can't add pair to loop {0}!".format(idstring))
def parse_mpath(self, dlist): """parse path from inkscape-style d attr list 'm x,y dx,dy dx,dy ... [z]' """ relative = True # discard initial m if dlist.pop(0) == "M": relative = False # loop to fill with vertices loop = Loop2()
return member.hasPermission(ManagePortal, self.context)
return member.has_permission(ManagePortal, self.context)
def isManager(self): mt = getToolByName(self, 'portal_membership') member = mt.getAuthenticatedMember() return member.hasPermission(ManagePortal, self.context)
print '-'*80 print manager_name
def push_assignment(self, userid='', roles=[]):
print id, assignment
mapping2[id] = assignment
def push_assignment(self, userid='', roles=[]):
return 'done'
return self.request.response.redirect(self.context.absolute_url())
def push_assignment(self, userid='', roles=[]):
self.request.response.redirect(folder.absolute_url() + '/portal_factory/Portlet Page/%s/edit' % time.time())
self.request.response.redirect(folder.absolute_url() + '/createObject?type_name=Portlet+Page')
def new_dashboard_page(self): """ Create a new dashboard page inside the dedicated dashboard templates folder. """
def match(input_reader):
def match(self, input_reader):
def match(input_reader): """ Match the given rule in the string from the given position on.
return self.returnToken(self.callAction([self.__string]))
return self.returnToken(self.callAction(self.__string))
def match(self, input_reader): """ Match this rule against the input.
retval.append(self.__rule.match(input_reader))
if input_reader.getIgnoreState(): input_reader.skipWhite() retval.append(self.__rule.match(input_reader))
def match(self, input_reader): """ Match the rule against the input. The rule will try to match as many bytes as possible from the input against the subrule. It matches successfully, if the subrule matches at least once.
logging.debug("Getting char at position %d" % self.__current_pos) logging.debug("Getting char at position %d" % self.__current_pos)
logging.debug("Getting char at position %d: '%s'" % (self.__current_pos, self.__string[self.__current_pos]))
def getChar(self): """ Get a single character from the string. This methdo returns the next character of the string. If ignore_whitespace is True, this will be the next non-whitespace character.
@return True if the input was fully consumed, False otherwise.
@return: True if the input was fully consumed, False otherwise.
def full(self): """ Check whether the input was fully consumed.
@return An OrRule-object connecting these two rule appropriately.
@return: An OrRule-object connecting these two rule appropriately.
def __or__(self, second_rule): """ Define an operator to concat two rules via OR. The expressivness of the 'pseudo-language' defined by the framework heavily relies on operator overloading. The |-operator serves as a 'OR' expression, defining two alternative matches.
@return self
@return: self
def hide(self): """ Tell this rule to not produce any token output. The rule matches its token as normal but does not return any of them
raise ParseException("Expected char from: [%s] at %d" % (self.__set, input_reader.getPos()))
raise ParseException("Expected char from: [%s] at %d, got '%s'" % (self.__set, input_reader.getPos(), str(char)))
def match(self, input_reader): """ Match a character from the input. Depending on the setting of the input reader, the next character ist matched directly or the next non-whitespace character is matched.
@return A string describing the rule
@return: A string describing the rule
def __str__(self): """ Return a human readable representation of the rule.
@return a string describing this rule.
@return: a string describing this rule.
def __str__(self): """ Return a human-readable representation of the rule object.
@return A description of this rule.
@return: A description of this rule.
def __str__(self): """ Return a human readable representation of the rule.
input_reader.skipWhite()
def match(self, input_reader): """ Match this rule against the input. The rule sets the input reader into 'match whitespace' mode, matches the subrule, resets the ignore state and returns the results of the subrule.
if release:
if release_flag:
def fail(out): status, stdout = out if status != 0: print "#" * 24 print stdout print "#" * 24 clean() sys.exit() return out
if not release:
if not release_flag:
def fail(out): status, stdout = out if status != 0: print "#" * 24 print stdout print "#" * 24 clean() sys.exit() return out
"lucid": "debian_collate_karmic-lucid", "karmic": "debian_collate_karmic-lucid", "jaunty": "debian_collate_hardy-intrepid-jaunty", "hardy": "debian_collate_hardy-intrepid-jaunty", "intrepid": "debian_collate_hardy-intrepid-jaunty"}
"jaunty": "debian_collate_hardy-intrepid-jaunty",}
def fail(out): status, stdout = out if status != 0: print "#" * 24 print stdout print "#" * 24 clean() sys.exit() return out
(scrollback_text, attributes_) = page.vt.get_text(selected_cb, 1)
scrollback_text = page.vt.get_text(selected_cb, False)
def selected_cb(terminal, c, row, cb_data): return 1
bitmap = wx.Bitmap( os.path.join(Utils.getImageFolder(), 'Vintage_CX.jpg'), wx.BITMAP_TYPE_JPEG )
bitmap = wx.Bitmap( os.path.join(Utils.getImageFolder(), 'vintage_CX.jpg'), wx.BITMAP_TYPE_JPEG )
def ShowSplashScreen(): #bitmap = wx.Bitmap( os.path.join(Utils.getImageFolder(), '20081124_cyclocross02.jpg'), wx.BITMAP_TYPE_JPEG ) bitmap = wx.Bitmap( os.path.join(Utils.getImageFolder(), 'Vintage_CX.jpg'), wx.BITMAP_TYPE_JPEG ) estyle = AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT shadow = wx.WHITE try: frame = AS.Advanc...
dc.SetPen(wx.Pen('light gray', 1))
dc.SetPen(wx.Pen(wx.BLACK, 1))
def Draw(self, dc): size = self.GetClientSize() width = size.width height = size.height backColour = self.GetBackgroundColour() backBrush = wx.Brush(backColour, wx.SOLID) backPen = wx.Pen(backColour, 0) dc.SetBackground(backBrush) dc.Clear() if not self.data or width < 50 or height < 50: self.empty = True return self...
dc.DrawLine( x, yBottom+4, x, yTop-4 )
dc.DrawLine( x, yBottom+3, x, yTop-3 )
def Draw(self, dc): size = self.GetClientSize() width = size.width height = size.height backColour = self.GetBackgroundColour() backBrush = wx.Brush(backColour, wx.SOLID) backPen = wx.Pen(backColour, 0) dc.SetBackground(backBrush) dc.Clear() if not self.data or width < 50 or height < 50: self.empty = True return self...
dc = wx.PaintDC(self)
dc = wx.BufferedPaintDC(self)
def OnPaint(self, event): #dc = wx.BufferedPaintDC(self) dc = wx.PaintDC(self) self.Draw(dc)
pdd.SetToPage(1)
pdd.SetAllPages( 1 ) pdd.EnablePageNumbers( 0 ) pdd.EnableHelp( 0 )
def menuPrint( self, event ): pdd = wx.PrintDialogData(self.printData) pdd.SetToPage(1) printer = wx.Printer(pdd) printout = CrossMgrPrintout()
Utils.MessageOK(self, "There was a printer problem.\nCheck your printer setup.", "Printing",iconMask=wx.ICON_ERROR)
if printer.GetLastError() == wx.PRINTER_ERROR: Utils.MessageOK(self, "There was a printer problem.\nCheck your printer setup.", "Printer Error",iconMask=wx.ICON_ERROR)
def menuPrint( self, event ): pdd = wx.PrintDialogData(self.printData) pdd.SetToPage(1) printer = wx.Printer(pdd) printout = CrossMgrPrintout()
dc.DrawRectangle( xLast, yLast, xCur - xLast, yCur - yLast-2 )
dc.DrawRectangle( xLast, yLast, xCur - xLast + 1, yCur - yLast + 1 )
def Draw(self, dc): size = self.GetClientSize() width = size.width height = size.height backColour = self.GetBackgroundColour() backBrush = wx.Brush(backColour, wx.SOLID) dc.SetBackground(backBrush) dc.Clear() if not self.data or width < 50 or height < 50: return
m_created.setMeeting_type('meeting_dates_additional')
m_created.setMeeting_type('meeting')
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
The ids are schemata names concatenated by _
def getMeetingTypes(self): """Returns a DisplayList of meeting types
errors = {}
errors = []
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
translate('label_create_from_poodle', 'ftw.meeting'),
translate( 'label_create_from_poodle', 'ftw.meeting', context=self.request),
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
return translate('duplication_error_text', 'ftw_meeting')
return translate( 'duplication_error_text', 'ftw_meeting', context=self.request)
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
return translate('dissalowed_error_text', 'ftw_meeting')
return translate( 'disallowed_error_text', 'ftw_meeting', context=self.request)
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
except SyntaxError:
except DateTimeSyntaxError:
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
mapping={'url': m_created.absolute_url(), 'title': m_title})
mapping={'url': m_created.absolute_url(), 'title': m_title}, context=self.request)
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
'title': m_title, 'errors' : [e+", " for e in errors]})
'title': m_title}, context=self.request)
def __call__(self, date_hash=None): """If successfull this view returns a small part html Example: <a href="url/to/meeting">Meeting</a> this will be displayed as statusmessage
for obj in self.listFolderContents(portal_type='Meeting Item', full_objects=True): for rel in obj.relatedItems(): if rel.portal_type=='Task': related_tasks.append(rel)
for obj in self.context.getFolderContents(full_objects=True): if obj.portal_type=='Meeting Item': for rel in obj.relatedItems(): if rel.portal_type=='Task': related_tasks.append(rel)
def write(*lines): latex.extend(lines)
write(r'%s, %s\\' %
present = conv({'present':'anwesend', 'absent':'abwesend', 'excused':'entschuldigt'}.get(row.get('present',''), '')) present = len(present) and (", %s" % present) or present write(r'%s%s\\' %
def write(*lines): latex.extend(lines)
conv({'present':'anwesend', 'absent':'abwesend', 'excused':'entschuldigt'}.get(row['present'], 'anwesend'))
present
def write(*lines): latex.extend(lines)
for i, date in enumerate(self.poodle_result['dates']): dates_record = self.context.getDates()[i] options_list.append( dict( hash=self.poodle_result['ids'][i], date=dates_record['date'], duration=dates_record['duration'], counter=self.poodle_result['result'][i]))
if self.poodle_result: for i, date in enumerate(self.poodle_result['dates']): dates_record = self.context.getDates()[i] options_list.append( dict( hash=self.poodle_result['ids'][i], date=dates_record['date'], duration=dates_record['duration'], counter=self.poodle_result['result'][i]))
def update(self): """define some values to grap from template"""
return self.getUsers()
users = list(set(self.getUsers() + [a.get('contact', '') for a in self.getResponsibility()])) return users
def getAttendeesOrUsers(self): if self.getMeeting_type() == 'poodle_additional': return self.getUsers() elif self.getMeeting_type() == 'meeting_dates_additional': return [a.get('contact', '') for a in self.getAttendees()] else: return
return [a.get('contact', '') for a in self.getAttendees()]
users = list(set([a.get('contact', '') for a in self.getAttendees()] + [a.get('contact', '') for a in self.getResponsibility()])) return users
def getAttendeesOrUsers(self): if self.getMeeting_type() == 'poodle_additional': return self.getUsers() elif self.getMeeting_type() == 'meeting_dates_additional': return [a.get('contact', '') for a in self.getAttendees()] else: return
return
return [a.get('contact', '') for a in self.getResponsibility()]
def getAttendeesOrUsers(self): if self.getMeeting_type() == 'poodle_additional': return self.getUsers() elif self.getMeeting_type() == 'meeting_dates_additional': return [a.get('contact', '') for a in self.getAttendees()] else: return
tarf.add(tmp_file_graph.name, arcname= module.name + '_module.png')
def _generate(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) module_model = pool.get('ir.module.module') module_ids = data['ids']
return res
return res def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=...
def _get_reports(self, cr, uid, context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) group_obj = pool.get('ir.actions.report.xml') ids = group_obj.search(cr, uid, [('document_id', '=', document_id)]) res = [(group.id, group.name) for group in group_obj.browse(cr, uid, ids)] res.sort(lambda x...
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
report_list_fields = { 'report': {'string': 'Select Report', 'type': 'selection', 'selection': _get_reports, }, 'address_id': {'string': 'Select Customer Address', 'type': 'many2one', 'relation': 'res.partner.address', 'domain': [('partner_id.category_id', '=', 'DTP Preview Customers')] }, 'segment_id': {'string': 'Sel...
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
domain = [] if address: pool = pooler.get_pool(cr.dbname) wi_obj = pool.get('dm.workitem') workitem_ids = wi_obj.search(cr, uid, [('address_id', '=', address)]) segment_ids = list(set([wi.segment_id.id for wi in wi_obj.browse(cr, uid, workitem_ids) if wi.segment_id.id])) domain = [('id', 'in', tuple(segment_ids))]
report_send_fields = { 'mail_service_id': {'string': 'Select Mail Service', 'type': 'many2one', 'relation': 'dm.mail_service',}, }
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
self.states['init2']['result']['fields']['segment_id']['domain'] = domain return {} report_list_fields1 = { 'report': { 'string': 'Select Report', 'type': 'selection', 'selection': _get_reports, }, 'address_id': { 'string': 'Select Customer Address', 'type': 'many2one', 'relation': 'res.partner.address', 'selection':...
states = {
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
'result': { 'type': 'form', 'arch': report_list_form1, 'fields': report_list_fields1, 'state': [('end', 'Cancel'), ('init2', 'Select Segment'),], } }, 'init2': { 'actions': [_set_segment], 'result': { 'type': 'form', 'arch': report_list_form2, 'fields': report_list_fields2, 'state': [('end', 'Cancel'), ('print_report',...
'result': {'type': 'form', 'arch': report_list_form, 'fields': report_list_fields, 'state': [('end', 'Cancel'),('print_report', 'Print Report'), ('send_report', 'Send Report'),]} },
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
'result': { 'type': 'print', 'report': '', 'state': 'end', } },
'result': {'type': 'print', 'report': '', 'state': 'end'} },
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
cr.execute("select po.id, max(po.date_approve) from purchase_order as po, purchase_order_line as line where po.id=line.order_id and product_id=%s and partner_id=%s and state='approved' group by po.id", (supinfo.product_id.id, supinfo.name.id,))
cr.execute("select po.id, max(po.date_approve) from purchase_order as po, purchase_order_line as line where po.id=line.order_id and line.product_id=%s and po.partner_id=%s and po.state='approved' group by po.id", (supinfo.product_id.id, supinfo.name.id,))
def _last_order(self, cr, uid, ids, name, arg, context): res = {} for supinfo in self.browse(cr, uid, ids): cr.execute("select po.id, max(po.date_approve) from purchase_order as po, purchase_order_line as line where po.id=line.order_id and product_id=%s and partner_id=%s and state='approved' group by po.id", (supinfo.p...
if 'WARNING' in note:
if note and 'WARNING' in note:
def execute_transformation(self, cr, uid, id, filter, log_file_name, attachment_id, context): transfo = self.read(cr, uid, id, ['kettle_dir','file_name'], context) logger = netsvc.Logger() file = transfo['kettle_dir']+'/transformations/'+transfo['file_name'] if not os.path.isfile(file + '.ktr'): raise osv.except_osv('E...
_frame_width = str(_pageSize[0]) _frame_height = str(float(_pageSize[1].replace('cm','')) - float(1.90))+'cm' _tbl_widths = str(float(_pageSize[0].replace('cm','')) - float(2.10))+'cm'
_frame_width = tools.ustr(_pageSize[0]) _frame_height = tools.ustr(float(_pageSize[1].replace('cm','')) - float(1.90))+'cm' _tbl_widths = tools.ustr(float(_pageSize[0].replace('cm','')) - float(2.10))+'cm'
def create(self, cr, uid, ids, datas, context):
<lines>1.0cm """+str(float(_pageSize[1].replace('cm','')) - float(1.00))+'cm'+""" """+str(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+""" """+str(float(_pageSize[1].replace('cm','')) - float(1.00))+'cm'+"""</lines> <lines>1.0cm """+str(float(_pageSize[1].replace('cm','')) - float(1.00))+'cm'+""" 1.0cm 1.00...
<lines>1.0cm """+tools.ustr(float(_pageSize[1].replace('cm','')) - float(1.00))+'cm'+""" """+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+""" """+tools.ustr(float(_pageSize[1].replace('cm','')) - float(1.00))+'cm'+"""</lines> <lines>1.0cm """+tools.ustr(float(_pageSize[1].replace('cm','')) - floa...
def create(self, cr, uid, ids, datas, context):
<drawRightString x='"""+str(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">Page : <pageNumber/> </drawRightString>"""
<drawRightString x='"""+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">Page : <pageNumber/> </drawRightString>"""
def create(self, cr, uid, ids, datas, context):
<tr><td><para style="page">"""+ str(seq) + """. """ + to_xml(page.title) + """</para></td></tr>
<tr><td><para style="page">"""+ tools.ustr(seq) + """. """ + to_xml(page.title) + """</para></td></tr>
def create(self, cr, uid, ids, datas, context):
colWidths = "cm,".join(map(str, cols_widhts))
colWidths = "cm,".join(map(tools.ustr, cols_widhts))
def create(self, cr, uid, ids, datas, context):
<para style="answer">""" + to_xml(str(que.descriptive_text)) + """</para>
<para style="answer">""" + to_xml(tools.ustr(que.descriptive_text)) + """</para>
def create(self, cr, uid, ids, datas, context):
answer.append(to_xml(str((ans.answer))))
answer.append(to_xml(tools.ustr((ans.answer))))
def create(self, cr, uid, ids, datas, context):
colWidths = "cm,".join(map(str, cols_widhts))
colWidths = "cm,".join(map(tools.ustr, cols_widhts))
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
matrix_ans.append(str(que.column_name))
matrix_ans.append(tools.ustr(que.column_name))
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
rml+="""<td><para style="answer">""" + to_xml(str(ans.answer)) + """</para></td>"""
rml+="""<td><para style="answer">""" + to_xml(tools.ustr(ans.answer)) + """</para></td>"""
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
value = """ <fill color="white"/> <rect x="-0.1cm" y="-0.45cm" width='""" + str(cols_widhts[-1] - 0.5) +"cm" + """' height="0.5cm" fill="yes" stroke="yes"/> """
value = """ <fill color="white"/> <rect x="-0.1cm" y="-0.45cm" width='""" + tools.ustr(cols_widhts[-1] - 0.5) +"cm" + """' height="0.5cm" fill="yes" stroke="yes" round="0.1cm"/> """
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
<rect x="0.1cm" y="-0.4cm" width="0.5 cm" height="0.5cm" fill="yes" stroke="yes"/>
<rect x="0.1cm" y="-0.4cm" width="0.5 cm" height="0.5cm" fill="yes" stroke="yes" round="0.1cm"/>
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
<td><para style="answer_left">""" + to_xml(str(que.column_name)) + """</para>
<td><para style="answer_left">""" + to_xml(tools.ustr(que.column_name)) + """</para>
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
<rect x="0.0cm" y="-0.5cm" width='"""+str((sum-tmp)-0.2)+ "cm" + """' height="0.5cm" fill="yes" stroke="yes" round="0.1cm"/>
<rect x="-0.15cm" y="-0.5cm" width='"""+tools.ustr(rec_width)+"""' height="0.5cm" fill="yes" stroke="yes" round="0.1cm"/>
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
colWidths = "cm,".join(map(str, cols_widhts)) colWidths = str(colWidths) + 'cm'
colWidths = "cm,".join(map(tools.ustr, cols_widhts)) colWidths = tools.ustr(colWidths) + 'cm'
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
rect_len = str(cols_widhts[0] - 0.3) + "cm"
rect_len = tools.ustr(cols_widhts[0] - 0.3) + "cm"
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
<td><para style="answer">""" + to_xml(str(ans.answer)) + """</para></td>
<td><para style="answer">""" + to_xml(tools.ustr(ans.answer)) + """</para></td>
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
<rect x="0.0cm" y="-0.5cm" width='""" + str(rect_len) + """' height="0.6cm" fill="no" stroke="yes"/>
<rect x="0.0cm" y="-0.5cm" width='""" + tools.ustr(rect_len) + """' height="0.6cm" fill="no" stroke="yes"/>
def divide_list(lst, n): return [lst[i::n] for i in range(n)]
val['user_id']=assing_id
val['user_id']=assing_id[0]
def _find_project_bug(self, cr, uid,section_id,lp_server=None,context={}):
lp_last_up_timestamp = time.mktime(time.strptime(lp_last_up_time,'%Y-%m-%d %H:%M:%S'))
lp_last_up_timestamp = time.mktime(time.strptime(lp_last_up_time,"%Y-%m-%dT%H:%M:%S"))+ time.timezone
def _find_project_bug(self, cr, uid,section_id,lp_server=None,context={}):
local_last_up_timestamp = time.mktime(time.strptime(local_last_up_time,'%Y-%m-%d %H:%M:%S')) + time.timezone local_last_up_timestamp1 = time.mktime(time.strptime(local_last_up_time,'%Y-%m-%d %H:%M:%S'))
local_last_up_timestamp = time.mktime(time.strptime(local_last_up_time,"%Y-%m-%dT%H:%M:%S")) + time.timezone local_last_up_timestamp1 = time.mktime(time.strptime(local_last_up_time,'%Y-%m-%dT%H:%M:%S'))
def _find_project_bug(self, cr, uid,section_id,lp_server=None,context={}):
print "result:::",result
def get_data(self,object):
'get_total_ambassy':self._get_total_ambassy
'get_total_ambassy':self._get_total_embassy
def __init__(self, cr, uid, name, context): super(stats_mission_type, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_missions_states': self._get_missions_states, 'get_total_certi': self._get_total_certi, 'get_total_legalization':self._get_total_legalization, 'get_total_ata':self._g...
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\
def _get_missions_states(self,d1,d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(d.goods_value) as no_goods, \ sum(c.total) as total_sub, d.type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t, cci_missions_certificate as c \ where c.dossier_id = d.id and d.type_id=t.id...
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
res_ata = self.cr.dictfetchall()
res_cert = self.cr.dictfetchall() self.cr.execute("select t.section, count(t.id) as no_certi, sum(d.goods_value) as no_goods, \ sum(l.total) as total_sub, d.type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t, cci_missions_legalization as l \ where l.dossier_id = d.id and d.type_id=t.id ...
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\
where d.type_id=t.id and ( d.creation_date::date BETWEEN '%s' AND '%s' )\
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
res_ata1 = self.cr.dictfetchall() self.cr.execute("select count(e.id) as no_certi, sum(l.customer_amount) as total_sub, s.name\ from cci_missions_embassy_folder as e \ left join cci_missions_embassy_folder_line as l \
res_ata = self.cr.dictfetchall() self.cr.execute("select count(e.id) as no_certi, sum( l.total_sub ) as total_sub, s.name from cci_missions_embassy_folder as e \ left join \ ( select folder_id, sum( customer_amount-courier_cost ) as total_sub from cci_missions_embassy_folder_line group by folder_id ) as l \
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
left join cci_missions_site as s \ on s.id=e.site_id where (e.create_date BETWEEN '%s' AND '%s' ) \ group by s.name" % (d1, d2))
left join cci_missions_site as s on s.id=e.site_id \ where (e.embassy_date BETWEEN '%s' AND '%s' ) group by s.name;" % (d1, d2))
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
return res_ata + res_ata1 + temp_list
return res_cert + res_leg + res_ata + temp_list
def _get_missions_states(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub, type_id, t.name \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and ( t.create_date BETWEEN '%s' AND '%s' )\ group b...
sum(sub_total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and t.section=\'certificate\' \ and (d.create_date::date BETWEEN '%s' AND '%s' )\
sum(c.total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t, cci_missions_certificate as c \ where c.dossier_id = d.id and d.type_id=t.id and t.section=\'certificate\' \ and (d.date::date BETWEEN '%s' AND '%s' )\
def _get_total_certi(self, d1, d2): self.cr.execute("select t.section, count(t.id) as no_certi, sum(goods_value) as no_goods, \ sum(sub_total) as total_sub \ from cci_missions_dossier as d,cci_missions_dossier_type as t \ where d.type_id=t.id and t.section=\'certificate\' \ and (d.create_date::date BETWEEN '%s' AND '...