E4XML/ProjectHandler.py

changeset 5
fa319c01b604
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
4:ed9829a5fe55 5:fa319c01b604
104 104
105 def endProjectWordList(self): 105 def endProjectWordList(self):
106 """ 106 """
107 Handler method for the "ProjectWordList" end tag. 107 Handler method for the "ProjectWordList" end tag.
108 """ 108 """
109 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 109 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
110 self.project.pdata["SPELLWORDS"] = [path] 110 self.project.pdata["SPELLWORDS"] = [path]
111 111
112 def endProjectExcludeList(self): 112 def endProjectExcludeList(self):
113 """ 113 """
114 Handler method for the "ProjectExcludeList" end tag. 114 Handler method for the "ProjectExcludeList" end tag.
115 """ 115 """
116 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 116 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
117 self.project.pdata["SPELLEXCLUDES"] = [path] 117 self.project.pdata["SPELLEXCLUDES"] = [path]
118 118
119 def startProgLanguage(self, attrs): 119 def startProgLanguage(self, attrs):
120 """ 120 """
121 Handler method for the "Source" start tag. 121 Handler method for the "Source" start tag.
321 def endTranslationPattern(self): 321 def endTranslationPattern(self):
322 """ 322 """
323 Handler method for the "TranslationPattern" end tag. 323 Handler method for the "TranslationPattern" end tag.
324 """ 324 """
325 self.project.pdata["TRANSLATIONPATTERN"].append( 325 self.project.pdata["TRANSLATIONPATTERN"].append(
326 unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer)))) 326 Utilities.toNativeSeparators(self.utf8_to_code(self.buffer)))
327 327
328 def startTranslationsBinPath(self, attrs): 328 def startTranslationsBinPath(self, attrs):
329 """ 329 """
330 Handler method for the "TranslationsBinPath" start tag. 330 Handler method for the "TranslationsBinPath" start tag.
331 331
337 def endTranslationsBinPath(self): 337 def endTranslationsBinPath(self):
338 """ 338 """
339 Handler method for the "TranslationsBinPath" end tag. 339 Handler method for the "TranslationsBinPath" end tag.
340 """ 340 """
341 if self.version >= '4.3': 341 if self.version >= '4.3':
342 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 342 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
343 else: 343 else:
344 path = self.__buildPath() 344 path = self.__buildPath()
345 self.project.pdata["TRANSLATIONSBINPATH"].append(path) 345 self.project.pdata["TRANSLATIONSBINPATH"].append(path)
346 346
347 def startSource(self, attrs): 347 def startSource(self, attrs):
356 def endSource(self): 356 def endSource(self):
357 """ 357 """
358 Handler method for the "Source" end tag. 358 Handler method for the "Source" end tag.
359 """ 359 """
360 if self.version >= '4.3': 360 if self.version >= '4.3':
361 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 361 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
362 else: 362 else:
363 path = self.__buildPath() 363 path = self.__buildPath()
364 self.project.pdata["SOURCES"].append(path) 364 self.project.pdata["SOURCES"].append(path)
365 365
366 def startForm(self, attrs): 366 def startForm(self, attrs):
375 def endForm(self): 375 def endForm(self):
376 """ 376 """
377 Handler method for the "Form" end tag. 377 Handler method for the "Form" end tag.
378 """ 378 """
379 if self.version >= '4.3': 379 if self.version >= '4.3':
380 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 380 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
381 else: 381 else:
382 path = self.__buildPath() 382 path = self.__buildPath()
383 self.project.pdata["FORMS"].append(path) 383 self.project.pdata["FORMS"].append(path)
384 384
385 def startTranslation(self, attrs): 385 def startTranslation(self, attrs):
394 def endTranslation(self): 394 def endTranslation(self):
395 """ 395 """
396 Handler method for the "Translation" end tag. 396 Handler method for the "Translation" end tag.
397 """ 397 """
398 if self.version >= '4.3': 398 if self.version >= '4.3':
399 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 399 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
400 else: 400 else:
401 path = self.__buildPath() 401 path = self.__buildPath()
402 self.project.pdata["TRANSLATIONS"].append(path) 402 self.project.pdata["TRANSLATIONS"].append(path)
403 403
404 def startTranslationException(self, attrs): 404 def startTranslationException(self, attrs):
413 def endTranslationException(self): 413 def endTranslationException(self):
414 """ 414 """
415 Handler method for the "TranslationException" end tag. 415 Handler method for the "TranslationException" end tag.
416 """ 416 """
417 if self.version >= '4.3': 417 if self.version >= '4.3':
418 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 418 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
419 else: 419 else:
420 path = self.__buildPath() 420 path = self.__buildPath()
421 self.project.pdata["TRANSLATIONEXCEPTIONS"].append(path) 421 self.project.pdata["TRANSLATIONEXCEPTIONS"].append(path)
422 422
423 def startResource(self, attrs): 423 def startResource(self, attrs):
432 def endResource(self): 432 def endResource(self):
433 """ 433 """
434 Handler method for the "Resource" end tag. 434 Handler method for the "Resource" end tag.
435 """ 435 """
436 if self.version >= '4.3': 436 if self.version >= '4.3':
437 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 437 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
438 else: 438 else:
439 path = self.__buildPath() 439 path = self.__buildPath()
440 self.project.pdata["RESOURCES"].append(path) 440 self.project.pdata["RESOURCES"].append(path)
441 441
442 def startInterface(self, attrs): 442 def startInterface(self, attrs):
451 def endInterface(self): 451 def endInterface(self):
452 """ 452 """
453 Handler method for the "Interface" end tag. 453 Handler method for the "Interface" end tag.
454 """ 454 """
455 if self.version >= '4.3': 455 if self.version >= '4.3':
456 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 456 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
457 else: 457 else:
458 path = self.__buildPath() 458 path = self.__buildPath()
459 self.project.pdata["INTERFACES"].append(path) 459 self.project.pdata["INTERFACES"].append(path)
460 460
461 def startOther(self, attrs): 461 def startOther(self, attrs):
470 def endOther(self): 470 def endOther(self):
471 """ 471 """
472 Handler method for the "Other" end tag. 472 Handler method for the "Other" end tag.
473 """ 473 """
474 if self.version >= '4.3': 474 if self.version >= '4.3':
475 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 475 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
476 else: 476 else:
477 path = self.__buildPath() 477 path = self.__buildPath()
478 self.project.pdata["OTHERS"].append(path) 478 self.project.pdata["OTHERS"].append(path)
479 479
480 def startMainScript(self, attrs): 480 def startMainScript(self, attrs):
489 def endMainScript(self): 489 def endMainScript(self):
490 """ 490 """
491 Handler method for the "MainScript" end tag. 491 Handler method for the "MainScript" end tag.
492 """ 492 """
493 if self.version >= '4.3': 493 if self.version >= '4.3':
494 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 494 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
495 else: 495 else:
496 path = self.__buildPath() 496 path = self.__buildPath()
497 self.project.pdata["MAINSCRIPT"] = [path] 497 self.project.pdata["MAINSCRIPT"] = [path]
498 498
499 def startFiletypeAssociation(self, attrs): 499 def startFiletypeAssociation(self, attrs):
570 def endTranslationPrefix(self): 570 def endTranslationPrefix(self):
571 """ 571 """
572 Handler method for the "TranslationPrefix" end tag. 572 Handler method for the "TranslationPrefix" end tag.
573 """ 573 """
574 if self.version >= '4.3': 574 if self.version >= '4.3':
575 path = unicode(Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))) 575 path = Utilities.toNativeSeparators(self.utf8_to_code(self.buffer))
576 else: 576 else:
577 path = self.__buildPath() 577 path = self.__buildPath()
578 if not path.endswith("_"): 578 if not path.endswith("_"):
579 path = "%s_" % path 579 path = "%s_" % path
580 self.project.pdata["TRANSLATIONPATTERN"].append("%s%%language%%.ts" % path) 580 self.project.pdata["TRANSLATIONPATTERN"].append("%s%%language%%.ts" % path)

eric ide

mercurial