rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
new_id += '-'
newid += '-'
def get_image(self): """ Get the URL of the user's image.
valid_chars = string.letters+string.digits
valid_chars = string.letters+string.digits+'_'
def get_image(self): """ Get the URL of the user's image.
site_root.cookie_authentication.credentialsChanged(user, userID, newPassword)
logged_in_user = self.REQUEST.AUTHENTICATED_USER.getId() if (logged_in_user): site_root.cookie_authentication.credentialsChanged(user, userID, newPassword)
def set_password(self, newPassword): """Sets the user's password to 'newPassword'.
presentation = self.Templates.email.notifications.aq_explicit
presentation = site_root.Templates.email.notifications.aq_explicit
def send_notification(self, n_type, n_id): """ Send a notification to the user based on the type and ID of the notification.
def send_userVerification(self):
def send_userVerification(self, n_id='default'):
def send_userVerification(self): """ Send the user a verification email. """ presentation = self.Templates.email site_root = self.site_root() try: mailhost = site_root.superValues('Mail Host')[0] except: raise AttributeError, "Can't find a Mail Host object" email_addresses = self.get_emailAddresses() email_strings =...
presentation = self.Templates.email
def send_userVerification(self): """ Send the user a verification email. """ presentation = self.Templates.email site_root = self.site_root() try: mailhost = site_root.superValues('Mail Host')[0] except: raise AttributeError, "Can't find a Mail Host object" email_addresses = self.get_emailAddresses() email_strings =...
presentation.confirm_registration(self, self.REQUEST, to_addr=email_address, verification_code=self.get_verificationCode(), first_name=self.getProperty('firstName', ''), last_name=self.getProperty('lastName', ''), user_id=self.getId(), password=self.get_password()))
template(self, self.REQUEST, to_addr=email_address, verification_code=self.get_verificationCode(), first_name=self.getProperty('firstName', ''), last_name=self.getProperty('lastName', ''), user_id=self.getId(), password=self.get_password()))
def send_userVerification(self): """ Send the user a verification email. """ presentation = self.Templates.email site_root = self.site_root() try: mailhost = site_root.superValues('Mail Host')[0] except: raise AttributeError, "Can't find a Mail Host object" email_addresses = self.get_emailAddresses() email_strings =...
import string
import string, DateTime
def register_user(self, email, user_id='', first_name='', last_name='', password_length=8, roles=[], groups=[], post_wf=[]): """ A method for a user to allow a user to register themselves. """ import string validChars = string.letters+string.digits+'.' user_id_provided = False if user_id: user_id_provided = True if ...
valid_chars = string.letters+string.digits+'_'
valid_chars = string.letters+string.digits+'_.'
def get_image(self): """ Get the URL of the user's image.
thecontext.command("ban " + nickname +" 1")
thecontext.command("ban " + nickname)
def on_whois_channels(word, wordeol, userdata): global thecontext nickname = word[0].lower() channels = word[1].lower() for badword in option["badchannels"]: if badword in channels: thecontext.command("ban " + nickname +" 1") thecontext.command("kick " + nickname + " " + option["msgbadchannel"])
checklist[user.nick] = re.split('@', user.host)[1]
checklist[user.nick.lower()] = re.split('@', user.host)[1]
def clonescan(): global thecontext checklist = {} clones = {} allowed = [] userlist = thecontext.get_list('users') for user in userlist: checklist[user.nick] = re.split('@', user.host)[1] for user in checklist: if checklist.values().count(checklist[user]) > 1: clones[user] = checklist[user] #If host in option["allowclo...
for clone in clones: if re.search(option["allowclones"][key], clones[clone], re.I): allowed.append(clone)
if clones.has_key(key): if re.search(option["allowclones"][key], clones[key], re.I): allowed.append(key)
def clonescan(): global thecontext checklist = {} clones = {} allowed = [] userlist = thecontext.get_list('users') for user in userlist: checklist[user.nick] = re.split('@', user.host)[1] for user in checklist: if checklist.values().count(checklist[user]) > 1: clones[user] = checklist[user] #If host in option["allowclo...
option["autovoice"] = trigger[1].capitalize() destination.command("say autovoice has been set " + color["blue"]+option["autovoice"])
if trigger[1] == "true" or trigger[1] == "on" or trigger[1] == "yes": option["autovoice"] = True elif trigger[1] == "false" or trigger[1] == "off" or trigger[1] == "no": option["autovoice"] = False destination.command("say autovoice is set to " + color["blue"] + str(option["autovoice"]))
def on_text(word, word_eol, userdata): destination = xchat.get_context() triggerchannel = destination.get_info("channel") triggernick = word[0].lower() trigger = re.split(' ',word[1].lower()) prefix = "" if triggerchannel in option["opin"]: userlist = destination.get_list("users") for user in userlist: if triggernick ...
option["autovoice"] = trigger[1].capitalize() destination.command("say autovoice has been set "+color["blue"]+option["autovoice"]) save_vars()
if trigger[1] == "true" or trigger[1] == "on" or trigger[1] == "yes": option["autovoice"] = True elif trigger[1] == "false" or trigger[1] == "off" or trigger[1] == "no": option["autovoice"] = False destination.command("say autovoice is set to " + color["blue"] + str(option["autovoice"])) save_vars()
def on_text(word, word_eol, userdata): destination = xchat.get_context() triggerchannel = destination.get_info("channel") triggernick = word[0].lower() trigger = re.split(' ',word[1].lower()) prefix = "" if triggerchannel in option["opin"]: userlist = destination.get_list("users") for user in userlist: if triggernick ...
option["limitjoins"] = trigger[1].capitalize() destination.command("say limitjoins has been set " + color["blue"]+option["limitjoins"])
if trigger[1] == "true" or trigger[1] == "on" or trigger[1] == "yes": option["limitjoins"] = True elif trigger[1] == "false" or trigger[1] == "off" or trigger[1] == "no": option["limitjoins"] = False destination.command("say limitjoins is set to " + color["blue"] + str(option["limitjoins"]))
def on_text(word, word_eol, userdata): destination = xchat.get_context() triggerchannel = destination.get_info("channel") triggernick = word[0].lower() trigger = re.split(' ',word[1].lower()) prefix = "" if triggerchannel in option["opin"]: userlist = destination.get_list("users") for user in userlist: if triggernick ...
option["limitjoins"] = trigger[1].capitalize() destination.command("say limitjoins has been set "+color["blue"]+option["limitjoins"]) save_vars()
if trigger[1] == "true" or trigger[1] == "on" or trigger[1] == "yes": option["limitjoins"] = True elif trigger[1] == "false" or trigger[1] == "off" or trigger[1] == "no": option["limitjoins"] = False destination.command("say limitjoins has been set "+color["blue"] + str(option["limitjoins"])) save_vars()
def on_text(word, word_eol, userdata): destination = xchat.get_context() triggerchannel = destination.get_info("channel") triggernick = word[0].lower() trigger = re.split(' ',word[1].lower()) prefix = "" if triggerchannel in option["opin"]: userlist = destination.get_list("users") for user in userlist: if triggernick ...
pituus = len(line.sender)+3 pituus2 = mwx -1 - pituus x = 0
nik = line.sender.find('!') if nik > 0: nikki = line.sender[0:nik] else: nikki = line.sender justwords = line.text.split(' ') justwords2 = list() pituus2 = (mwx -1 - (len(nikki)+3)) for word in justwords: x = 0 if len(word) > pituus2: while len(word[x:len(word)]) > pituus2: justwords2.append(word[x:(x+pituus2)]) x = x...
def draw_lines_to_message_win(self,channel): # first clear the window self.messagewin.clear() lines = channel.lines mwy,mwx = self.messagewin.getmaxyx() currentline = 0 lines.reverse() # get the lines for lines splittedlines = list() # remember to fix later so that it will not slit words # it it is not necessery for li...
while x < len(line.text): sline = '<'+line.sender+'> ' +line.text[x:x+pituus2] x = x + pituus2 templines.append(sline)
for word in justwords2: if len(sline)+len(word) < mwx: if len(sline) == len(nikki)+3: sline = sline+''+word else: sline = sline+' '+word else: templines.append(sline) sline = '<'+nikki+'> '+word templines.append(sline)
def draw_lines_to_message_win(self,channel): # first clear the window self.messagewin.clear() lines = channel.lines mwy,mwx = self.messagewin.getmaxyx() currentline = 0 lines.reverse() # get the lines for lines splittedlines = list() # remember to fix later so that it will not slit words # it it is not necessery for li...
self.statuswin.clear()
self.statuswin.erase()
def update_status(self): # update the status bar self.statuswin.clear() chan = self.mwindows[self.active_mwindow] channelsupdated = '' for channel in self.mwindows: if channel.updated == 1: channelsupdated += " ["+str(self.mwindows.index(channel))+"]" self.statuswin.addstr(0,0,'['+chan.server+'] '+chan.name+' '+str(se...
self.nickwin.clear()
self.nickwin.erase()
def update_nickwin(self): self.nickwin.clear() chan = self.mwindows[self.active_mwindow] x = 0 maxy,maxx = self.scr.getmaxyx() for user in chan.users: self.nickwin.addstr(x,0,user.status+user.nick) x = x + 1 if x+3 > maxy: # break if too many nicks to fit window break self.nickwin.refresh()
def resizewindows(self,numlines=0):
def resizewindows(self): numlines = ((len(self.textbuffer.lines)-1))
def resizewindows(self,numlines=0): if numlines < 1: numlines = 0
self.messagewin.clear()
self.messagewin.erase()
def draw_lines_to_message_win(self,channel, uplines=0): # mark that we have seen the channel channel.updated = 0 # This is fucked up. Write better when time # first clear the window self.messagewin.clear() lines = channel.lines[:(len(channel.lines)-channel.linecount)] mwy,mwx = self.messagewin.getmaxyx() currentline =...
textbuffer = EditBuffer()
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
self.textbuffer.reset()
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
ch = self.typewin.getch(textbuffer.y,textbuffer.x)
ch = self.typewin.getch(self.textbuffer.y,self.textbuffer.x)
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
lines = textbuffer.input(ch,ty,tx)
lines = self.textbuffer.input(ch,ty,tx)
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
self.typewin.clear()
self.typewin.erase()
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
self.resizewindows(len(lines)-1)
self.resizewindows()
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
self.resizewindows(0)
self.resizewindows()
def start(self): self.irc.connect('ORJAnet','192.168.1.2',6667,'petteri','asd2dasv','dyksi') self.irc.start()
data = self.socket.recv ( 4096 ) lines = data.split('\r\n') self.messagequeue.put(QueueMessage(lines[0:-1],self.name))
data = temp+self.socket.recv(4096) nu = data.rfind('\n') if nu != len(data): temp = data[nu+1:] data = data[:nu] else: temp = '' lines = data.splitlines() self.messagequeue.put(QueueMessage(lines,self.name))
def run(self): while True: data = self.socket.recv ( 4096 ) # raw lines splitted with irc protocols line end mark # problem is that it leaves one empty line so we have # to send all but last lines to messagefunk lines = data.split('\r\n') self.messagequeue.put(QueueMessage(lines[0:-1],self.name))
myre2 = re.compile('\s[\S]+\s')
def messageparser(self,lines,sserver): myre = re.compile('#[\S]+') myre2 = re.compile('\s[\S]+\s') channelNM = "STATUS" # default channel wcommand = "NONE"
res2 = myre2.search(line) command = line[res2.start()+1:res2.end()-1]
catline = line[line.find(' ')+1:] command = catline[:catline.find(' ')]
def messageparser(self,lines,sserver): myre = re.compile('#[\S]+') myre2 = re.compile('\s[\S]+\s') channelNM = "STATUS" # default channel wcommand = "NONE"
params = line[res2.end():]
params = catline[catline.find(' ')+1:]
def messageparser(self,lines,sserver): myre = re.compile('#[\S]+') myre2 = re.compile('\s[\S]+\s') channelNM = "STATUS" # default channel wcommand = "NONE"
def main():
def main(argv):
def main(): lang = os.getenv("LANG","C") try: opts, args = getopt.getopt(argv, "hf:dl:d", ["help","lang="]) except getopt.GetoptError: usage() raise SystemExit for opt, arg in opts: if opt in ("-h", "--help"): usage() raise SystemExit elif opt in ("-l", "--lang"): lang = arg menu=xdg.Menu.parse() print "Dynamic {" par...
main()
main(sys.argv[1:])
def main(): lang = os.getenv("LANG","C") try: opts, args = getopt.getopt(argv, "hf:dl:d", ["help","lang="]) except getopt.GetoptError: usage() raise SystemExit for opt, arg in opts: if opt in ("-h", "--help"): usage() raise SystemExit elif opt in ("-l", "--lang"): lang = arg menu=xdg.Menu.parse() print "Dynamic {" par...
images.sort(lambda a,b: cmp(os.stat(a)[9], os.stat(b)[9]))
images.sort(lambda a,b: cmp(int(re.search(r'^img(\d+)',a).group(1)), int(re.search(r'^img(\d+)',b).group(1))))
def convert(self, output): """ Convert the output from LaTeX into images
log.warning(msg) return self.newImage(img.source)
log.warning('%s in image "%s". Reverting to LaTeX to generate the image.' % (msg, name)) return self.newImage(node.source)
def getImage(self, node): """ Get an image from the given node whatever way possible
return tex.textTokens(re.sub(r'\$\{\s*(\w+)(?:\.(\w+))?\s*\}', counterValue, format))
t = re.sub(r'\$\{\s*(\w+)(?:\.(\w+))?\s*\}', counterValue, format) t = re.sub(r'\b0[^\d]+', r'', t) return tex.textTokens(t)
def counterValue(m): """ Replace the counter values """ name = m.group(1)
def latex2htmlcolor(arg):
def ProcessOptions(options, document): colors = {} document.userdata.setPath('packages/color/colors', colors) colors['red'] = latex2htmlcolor('1,0,0') colors['green'] = latex2htmlcolor('0,1,0') colors['blue'] = latex2htmlcolor('0,0,1') colors['cyan'] = latex2htmlcolor('0,1,1') colors['magenta'] = latex2htmlcolor('1,0,...
def latex2htmlcolor(arg): if ',' in arg: red, green, blue = [float(x) for x in arg.split(',')] red = min(int(red * 255), 255) green = min(int(green * 255), 255) blue = min(int(blue * 255), 255) else: try: red = green = blue = float(arg) except ValueError: return arg.strip() return '#%.2X%.2X%.2X' % (red, green, blue)
return arg.strip()
try: return named[arg] except KeyError: return arg.strip()
def latex2htmlcolor(arg): if ',' in arg: red, green, blue = [float(x) for x in arg.split(',')] red = min(int(red * 255), 255) green = min(int(green * 255), 255) blue = min(int(blue * 255), 255) else: try: red = green = blue = float(arg) except ValueError: return arg.strip() return '#%.2X%.2X%.2X' % (red, green, blue)
class textcolor(Command): args = 'color:str self'
class definecolor(Command): args = 'name:str model:str color:str'
def latex2htmlcolor(arg): if ',' in arg: red, green, blue = [float(x) for x in arg.split(',')] red = min(int(red * 255), 255) green = min(int(green * 255), 255) blue = min(int(blue * 255), 255) else: try: red = green = blue = float(arg) except ValueError: return arg.strip() return '#%.2X%.2X%.2X' % (red, green, blue)
self.style['color'] = latex2htmlcolor(a['color'])
u = self.ownerDocument.userdata colors = u.getPath('packages/color/colors') colors[a['name']] = latex2htmlcolor(a['color'], a['model'], colors) class textcolor(Command): args = '[ model:str ] color:str self' def invoke(self, tex): a = self.parse(tex) self.style['color'] = latex2htmlcolor(a['color'], a['model'], self.o...
def invoke(self, tex): a = self.parse(tex) self.style['color'] = latex2htmlcolor(a['color'])
args = 'color:str'
args = '[ model:str ] color:str'
def invoke(self, tex): a = self.parse(tex) self.style['color'] = latex2htmlcolor(a['color'])
rv = {}
def get_msvs8_install_dirs(version = None, vs8suite = None): """ Get installed locations for various msvc-related products, like the .NET SDK and the Platform SDK. """ if not SCons.Util.can_read_reg: return {} if not version: versions = get_visualstudio_versions() if versions: version = versions[0] #use highest versi...
if vs8suite == 'EXPRESS':
if rv['VS8SUITE'] == 'EXPRESS':
def _get_msvc8_default_paths(version = None, vs8suite = None): rv = get_msvs8_install_dirs(version, vs8suite) include_path = "" include_path += os.path.join(rv['VCINSTALLDIR'], 'include') + ';' # In the express edition there is no PlatformSDK. if vs8suite == 'EXPRESS': include_path += os.path.join(rv['PLATFORMSDKDIR']...
include_path += os.path.join(rv['PLATFORMSDKDIR'], 'include') else: include_path += os.path.join(rv['VCINSTALLDIR'], 'PlatformSDK', 'include')
include_path += os.path.join(rv['PLATFORMSDKDIR'], 'include') + ';' include_path += os.path.join(rv['PLATFORMSDKDIR'], 'include', 'atl') else: include_path += os.path.join(rv['VCINSTALLDIR'], 'PlatformSDK', 'include') + ';' include_path += os.path.join(rv['VCINSTALLDIR'], 'PlatformSDK', 'include', 'atl')
def _get_msvc8_default_paths(version = None, vs8suite = None): rv = get_msvs8_install_dirs(version, vs8suite) include_path = "" include_path += os.path.join(rv['VCINSTALLDIR'], 'include') + ';' # In the express edition there is no PlatformSDK. if vs8suite == 'EXPRESS': include_path += os.path.join(rv['PLATFORMSDKDIR']...
print "Adding handle %s (%s)" % (handle,emr.__class__.__name__.lstrip('_'))
def addObject(self,emr,handle=-1): count=len(self.objects) if handle>0: print "Adding handle %s (%s)" % (handle,emr.__class__.__name__.lstrip('_')) if handle>=count: self.objects+=[None]*(handle-count+1) self.objects[handle]=emr elif self.objectholes: handle=self.objectholes.pop() self.objects[handle]=emr else: handle=...
print "removing handle %d (%s)" % (handle,self.objects[handle].__class__.__name__.lstrip('_'))
def removeObject(self,handle): if handle<1 or handle>=len(self.objects): raise IndexError("Invalid handle") print "removing handle %d (%s)" % (handle,self.objects[handle].__class__.__name__.lstrip('_')) self.objects[handle]=None found=False
print "creating format for %d" % self.__class__.emr_id
if self.verbose: print "creating format for %d" % self.__class__.emr_id
if self.__class__.format==None or self.__class__.emr_typedef != self.format.typedef: print "creating format for %d" % self.__class__.emr_id self.__class__.format=_EMR_FORMAT(self.__class__.emr_id,self.__class__.emr_typedef)
print "found %d extra bytes." % len(data)
if self.verbose: print "found %d extra bytes." % len(data)
def unserializeExtra(self,data): print "found %d extra bytes." % len(data)
print "str: %s" % self.description
if self.verbose: print "str: %s" % self.description
def unserializeExtra(self,data): print "found %d extra bytes." % len(data)
print "found %d extra bytes." % len(data)
def unserializeExtra(self,data): print "found %d extra bytes." % len(data)
print "found %d extra bytes. nChars=%d" % (len(data),self.nChars)
def unserializeExtra(self,data): print "found %d extra bytes. nChars=%d" % (len(data),self.nChars)
print "offDx=%d offString=%d" % (self.offDx,self.offString)
def unserializeExtra(self,data): print "found %d extra bytes. nChars=%d" % (len(data),self.nChars)
print "checking record %d" % i
print "FIXME: checking record %d" % i
def _getPathBounds(self): """Get the bounding rectangle for the list of EMR records starting from the last saved path start to the current record.""" for i in range(self.pathstart,len(self.records)): print "checking record %d" % i return (0,0,-1,-1)
def round4(num):
def _round4(num):
def round4(num): """Round to the nearest multiple of 4 greater than or equal to the given number. EMF records are required to be aligned to 4 byte boundaries.""" return ((num+3)/4)*4
Pack integer color values into an integer format as required by libEMF
Pack integer color values into a 32-bit integer format.
def RGB(r,g,b): """
def normalizeColor(c):
def _normalizeColor(c):
def normalizeColor(c): if isinstance(c,int): return c if isinstance(c,tuple) or isinstance(c,list): return RGB(*c) raise TypeError("Color must be specified as packed integer or 3-tuple (r,g,b)")
class DC:
class _DC:
def normalizeColor(c): if isinstance(c,int): return c if isinstance(c,tuple) or isinstance(c,list): return RGB(*c) raise TypeError("Color must be specified as packed integer or 3-tuple (r,g,b)")
class EMR_FORMAT:
class _EMR_FORMAT:
def popObject(self): """Remove last object. Used mainly in case of error.""" self.objects.pop()
class EMR_UNKNOWN(object):
class _EMR_UNKNOWN(object):
def appendFormat(self,typecode,name,default): self.fmt+=typecode self.fmtlist.append(typecode) self.defaults.append(default) self.namepos[name]=len(self.names) self.names.append(name)
self.__class__.format=EMR_FORMAT(self.__class__.emr_id,self.__class__.emr_typedef)
self.__class__.format=_EMR_FORMAT(self.__class__.emr_id,self.__class__.emr_typedef)
if self.__class__.format==None or self.__class__.emr_typedef != self.format.typedef: print "creating format for %d" % self.__class__.emr_id self.__class__.format=EMR_FORMAT(self.__class__.emr_id,self.__class__.emr_typedef)
f=EMR_UNKNOWN.__getattribute__(self,'format')
f=_EMR_UNKNOWN.__getattribute__(self,'format')
"""Return EMR attribute if the name exists in the typedef list
v=EMR_UNKNOWN.__getattribute__(self,'values')
v=_EMR_UNKNOWN.__getattribute__(self,'values')
"""Return EMR attribute if the name exists in the typedef list
f=EMR_UNKNOWN.__getattribute__(self,'format')
f=_EMR_UNKNOWN.__getattribute__(self,'format')
self.values[] if the name is in the typedef list."""
v=EMR_UNKNOWN.__getattribute__(self,'values')
v=_EMR_UNKNOWN.__getattribute__(self,'values')
self.values[] if the name is in the typedef list."""
extra=round4(len(txt))-len(txt)
extra=_round4(len(txt))-len(txt)
def serializeString(self,fh,txt): if isinstance(txt,unicode): # convert to unicode and throw away first two byte # signature. FIXME: need to check if we're on a # big-endian machine. txt=txt.encode('utf-16')[2:] fh.write(txt) extra=round4(len(txt))-len(txt) if extra>0: fh.write('\0'*extra)
val=EMR_UNKNOWN.__getattr__(self,name)
val=_EMR_UNKNOWN.__getattr__(self,name)
def str_decode(self,typecode,name): val=EMR_UNKNOWN.__getattr__(self,name) if name.endswith("olor"): val=self.str_color(val) elif typecode.endswith("s"): val=val.decode('utf-16') return val
return "**%s: iType=%s nSize=%s struct='%s' size=%d\n%s%s" % (self.__class__.__name__,self.iType,self.nSize,self.format.fmt,self.format.structsize,details,ret)
return "**%s: iType=%s nSize=%s struct='%s' size=%d\n%s%s" % (self.__class__.__name__.lstrip('_'),self.iType,self.nSize,self.format.fmt,self.format.structsize,details,ret)
def __str__(self): ret="" details=self.str_details() if details: ret=os.linesep return "**%s: iType=%s nSize=%s struct='%s' size=%d\n%s%s" % (self.__class__.__name__,self.iType,self.nSize,self.format.fmt,self.format.structsize,details,ret) return
class EMR: class HEADER(EMR_UNKNOWN):
class _EMR: class _HEADER(_EMR_UNKNOWN):
def __str__(self): ret="" details=self.str_details() if details: ret=os.linesep return "**%s: iType=%s nSize=%s struct='%s' size=%d\n%s%s" % (self.__class__.__name__,self.iType,self.nSize,self.format.fmt,self.format.structsize,details,ret) return
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self,description=''): EMR_UNKNOWN.__init__(self)
sizestring=round4(self.nDescription*2)
sizestring=_round4(self.nDescription*2)
def sizeExtra(self): self.szlMicrometers_cx=self.szlMillimeters_cx*1000 self.szlMicrometers_cy=self.szlMillimeters_cy*1000
class POLYBEZIER(EMR_UNKNOWN):
class _POLYBEZIER(_EMR_UNKNOWN):
def serializeExtra(self,fh): self.serializeString(fh,self.description)
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self,points=[],bounds=(0,0,0,0)): EMR_UNKNOWN.__init__(self) self.setBounds(bounds) self.cptl=len(points) self.aptl=points
class POLYGON(POLYBEZIER):
class _POLYGON(_POLYBEZIER):
def str_extra(self): txt=StringIO() start=0 txt.write("\tpoints: %s\n" % str(self.aptl)) return txt.getvalue()
class POLYLINE(POLYBEZIER):
class _POLYLINE(_POLYBEZIER):
def str_extra(self): txt=StringIO() start=0 txt.write("\tpoints: %s\n" % str(self.aptl)) return txt.getvalue()
class POLYBEZIERTO(POLYBEZIER):
class _POLYBEZIERTO(_POLYBEZIER):
def str_extra(self): txt=StringIO() start=0 txt.write("\tpoints: %s\n" % str(self.aptl)) return txt.getvalue()
class POLYLINETO(POLYBEZIER):
class _POLYLINETO(_POLYBEZIER):
def str_extra(self): txt=StringIO() start=0 txt.write("\tpoints: %s\n" % str(self.aptl)) return txt.getvalue()
class POLYPOLYLINE(EMR_UNKNOWN):
class _POLYPOLYLINE(_EMR_UNKNOWN):
def str_extra(self): txt=StringIO() start=0 txt.write("\tpoints: %s\n" % str(self.aptl)) return txt.getvalue()
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self): EMR_UNKNOWN.__init__(self)
class POLYPOLYGON(POLYPOLYLINE):
class _POLYPOLYGON(_POLYPOLYLINE):
def str_extra(self): txt=StringIO() start=0 for n in range(self.nPolys): txt.write("\tPolygon %d: %d points\n" % (n,self.aPolyCounts[n])) txt.write("\t\t%s\n" % str(self.aptl[start:start+self.aPolyCounts[n]])) start+=self.aPolyCounts[n] return txt.getvalue()
class SETWINDOWEXTEX(EMR_UNKNOWN):
class _SETWINDOWEXTEX(_EMR_UNKNOWN):
def str_extra(self): txt=StringIO() start=0 for n in range(self.nPolys): txt.write("\tPolygon %d: %d points\n" % (n,self.aPolyCounts[n])) txt.write("\t\t%s\n" % str(self.aptl[start:start+self.aPolyCounts[n]])) start+=self.aPolyCounts[n] return txt.getvalue()
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self,cx=0,cy=0): EMR_UNKNOWN.__init__(self) self.szlExtent_cx=cx self.szlExtent_cy=cy
class SETWINDOWORGEX(EMR_UNKNOWN):
class _SETWINDOWORGEX(_EMR_UNKNOWN):
def __init__(self,cx=0,cy=0): EMR_UNKNOWN.__init__(self) self.szlExtent_cx=cx self.szlExtent_cy=cy
EMR_UNKNOWN.__init__(self) class SETVIEWPORTEXTEX(SETWINDOWEXTEX):
_EMR_UNKNOWN.__init__(self) class _SETVIEWPORTEXTEX(_SETWINDOWEXTEX):
def __init__(self): EMR_UNKNOWN.__init__(self)
class SETVIEWPORTORGEX(SETWINDOWORGEX):
class _SETVIEWPORTORGEX(_SETWINDOWORGEX):
def __init__(self): EMR_UNKNOWN.__init__(self)
class SETBRUSHORGEX(SETWINDOWORGEX):
class _SETBRUSHORGEX(_SETWINDOWORGEX):
def __init__(self): EMR_UNKNOWN.__init__(self)
class EOF(EMR_UNKNOWN):
class _EOF(_EMR_UNKNOWN):
def __init__(self): EMR_UNKNOWN.__init__(self)
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self): EMR_UNKNOWN.__init__(self) # I don't know if I have a broken example or what, but # features.emf file only has a 12 byte long EOF record. # OpenOffice seems to handle it, though.
class SETPIXELV(EMR_UNKNOWN):
class _SETPIXELV(_EMR_UNKNOWN):
def __init__(self): EMR_UNKNOWN.__init__(self) # I don't know if I have a broken example or what, but # features.emf file only has a 12 byte long EOF record. # OpenOffice seems to handle it, though.
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self,x=0,y=0,color=0): EMR_UNKNOWN.__init__(self) self.ptlPixel_x=x self.ptlPixel_y=y self.crColor=color
class SETMAPPERFLAGS(EMR_UNKNOWN):
class _SETMAPPERFLAGS(_EMR_UNKNOWN):
def __init__(self,x=0,y=0,color=0): EMR_UNKNOWN.__init__(self) self.ptlPixel_x=x self.ptlPixel_y=y self.crColor=color
EMR_UNKNOWN.__init__(self) class SETMAPMODE(EMR_UNKNOWN):
_EMR_UNKNOWN.__init__(self) class _SETMAPMODE(_EMR_UNKNOWN):
def __init__(self): EMR_UNKNOWN.__init__(self)
EMR_UNKNOWN.__init__(self)
_EMR_UNKNOWN.__init__(self)
def __init__(self,mode=MM_ANISOTROPIC,last=MM_MAX): EMR_UNKNOWN.__init__(self) if mode<0 or mode>last: self.error=1 else: self.iMode=mode
class SETBKMODE(SETMAPMODE):
class _SETBKMODE(_SETMAPMODE):
def __init__(self,mode=MM_ANISOTROPIC,last=MM_MAX): EMR_UNKNOWN.__init__(self) if mode<0 or mode>last: self.error=1 else: self.iMode=mode
EMR.SETMAPMODE.__init__(self,mode,last=BKMODE_LAST) class SETPOLYFILLMODE(SETMAPMODE):
_EMR._SETMAPMODE.__init__(self,mode,last=BKMODE_LAST) class _SETPOLYFILLMODE(_SETMAPMODE):
def __init__(self,mode=OPAQUE): EMR.SETMAPMODE.__init__(self,mode,last=BKMODE_LAST)
EMR.SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)
_EMR._SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)
def __init__(self,mode=ALTERNATE): EMR.SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)
class SETROP2(SETMAPMODE):
class _SETROP2(_SETMAPMODE):
def __init__(self,mode=ALTERNATE): EMR.SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)
class SETSTRETCHBLTMODE(SETMAPMODE):
class _SETSTRETCHBLTMODE(_SETMAPMODE):
def __init__(self,mode=ALTERNATE): EMR.SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)
class SETTEXTALIGN(SETMAPMODE):
class _SETTEXTALIGN(_SETMAPMODE):
def __init__(self,mode=ALTERNATE): EMR.SETMAPMODE.__init__(self,mode,last=POLYFILL_LAST)