Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
Це архівний репозитарій. Ви можете переглядати і клонувати файли, але не можете робити пуш або відкривати питання/запити.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: module atr</title>
  3. </head><body bgcolor="#f0f0f8">
  4. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  5. <tr bgcolor="#7799ee">
  6. <td valign=bottom>&nbsp;<br>
  7. <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>atr</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/users/kaisd/documents/workbench/programming/ktt/src/atr.py">c:\users\kaisd\documents\workbench\programming\ktt\src\atr.py</a></font></td></tr></table>
  10. <p><tt>Advanced&nbsp;Text&nbsp;Replacer&nbsp;module&nbsp;for&nbsp;a&nbsp;KaiSD&nbsp;Text&nbsp;Tools.<br>
  11. &nbsp;<br>
  12. (c)&nbsp;2013&nbsp;Ivan&nbsp;"Kai&nbsp;SD"&nbsp;Korystin&nbsp;<br>
  13. &nbsp;<br>
  14. License:&nbsp;GPLv3</tt></p>
  15. <p>
  16. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  17. <tr bgcolor="#aa55cc">
  18. <td colspan=3 valign=bottom>&nbsp;<br>
  19. <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
  20. <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  21. <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="re.html">re</a><br>
  22. </td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
  23. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  24. <tr bgcolor="#ee77aa">
  25. <td colspan=3 valign=bottom>&nbsp;<br>
  26. <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
  27. <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  28. <td width="100%"><dl>
  29. <dt><font face="helvetica, arial"><a href="atr.html#ATR">ATR</a>
  30. </font></dt></dl>
  31. <p>
  32. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  33. <tr bgcolor="#ffc8d8">
  34. <td colspan=3 valign=bottom>&nbsp;<br>
  35. <font color="#000000" face="helvetica, arial"><a name="ATR">class <strong>ATR</strong></a></font></td></tr>
  36. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  37. <td colspan=2><tt>Advanced&nbsp;Text&nbsp;Replacer&nbsp;-&nbsp;is&nbsp;a&nbsp;class,&nbsp;created&nbsp;to&nbsp;make&nbsp;multiple&nbsp;replacements<br>
  38. in&nbsp;the&nbsp;content&nbsp;or&nbsp;names&nbsp;of&nbsp;text&nbsp;file.<br>
  39. It&nbsp;can&nbsp;make&nbsp;plain&nbsp;replacements,&nbsp;or&nbsp;use&nbsp;ATG&nbsp;templates&nbsp;to&nbsp;do&nbsp;something&nbsp;more&nbsp;complex.<br>&nbsp;</tt></td></tr>
  40. <tr><td>&nbsp;</td>
  41. <td width="100%">Methods defined here:<br>
  42. <dl><dt><a name="ATR-__init__"><strong>__init__</strong></a>(self, files)</dt><dd><tt>Constructor</tt></dd></dl>
  43. <dl><dt><a name="ATR-clear_replacements"><strong>clear_replacements</strong></a>(self)</dt><dd><tt>Removes&nbsp;all&nbsp;replacements.</tt></dd></dl>
  44. <dl><dt><a name="ATR-log"><strong>log</strong></a>(self, string)</dt><dd><tt>Print&nbsp;information</tt></dd></dl>
  45. <dl><dt><a name="ATR-plain_replace"><strong>plain_replace</strong></a>(self, pattern, string, regexp<font color="#909090">=False</font>)</dt><dd><tt>Replaces&nbsp;the&nbsp;given&nbsp;pattern&nbsp;with&nbsp;string&nbsp;in&nbsp;files.</tt></dd></dl>
  46. <dl><dt><a name="ATR-replace_in_names"><strong>replace_in_names</strong></a>(self)</dt><dd><tt>Do&nbsp;replacement,&nbsp;but&nbsp;in&nbsp;file&nbsp;names&nbsp;instead&nbsp;of&nbsp;file&nbsp;content.&nbsp;Returns&nbsp;the&nbsp;list&nbsp;of&nbsp;new&nbsp;file&nbsp;names,<br>
  47. you&nbsp;can&nbsp;use&nbsp;it&nbsp;with&nbsp;writeNewFiles()&nbsp;method.</tt></dd></dl>
  48. <dl><dt><a name="ATR-templated_replace"><strong>templated_replace</strong></a>(self, pattern, template, data, keyFormat<font color="#909090">='filename'</font>, regexp<font color="#909090">=False</font>)</dt><dd><tt>Replaces&nbsp;the&nbsp;given&nbsp;pattern&nbsp;with&nbsp;data&nbsp;formated&nbsp;by&nbsp;template.<br>
  49. Valid&nbsp;values&nbsp;for&nbsp;keyFormat:<br>
  50. filename&nbsp;-&nbsp;take&nbsp;data&nbsp;rows&nbsp;by&nbsp;filename(path&nbsp;ignored),&nbsp;key&nbsp;value&nbsp;of&nbsp;the&nbsp;data&nbsp;row&nbsp;should&nbsp;store&nbsp;the&nbsp;filename.<br>
  51. fullname&nbsp;-&nbsp;as&nbsp;filename,&nbsp;but&nbsp;with&nbsp;path.<br>
  52. index&nbsp;-&nbsp;take&nbsp;data&nbsp;rows&nbsp;in&nbsp;order,&nbsp;key&nbsp;value&nbsp;of&nbsp;the&nbsp;data&nbsp;row&nbsp;should&nbsp;store&nbsp;the&nbsp;index.&nbsp;Indexes&nbsp;starts&nbsp;with&nbsp;0.<br>
  53. If&nbsp;filename&nbsp;or&nbsp;index&nbsp;cannot&nbsp;be&nbsp;found&nbsp;in&nbsp;data&nbsp;keys,&nbsp;pattern&nbsp;will&nbsp;not&nbsp;be&nbsp;replaced.</tt></dd></dl>
  54. <dl><dt><a name="ATR-write_in_place"><strong>write_in_place</strong></a>(self)</dt><dd><tt>Do&nbsp;replacement&nbsp;and&nbsp;save&nbsp;the&nbsp;files</tt></dd></dl>
  55. <dl><dt><a name="ATR-write_new_files"><strong>write_new_files</strong></a>(self, outfiles)</dt><dd><tt>Do&nbsp;replacement,&nbsp;but&nbsp;save&nbsp;to&nbsp;given&nbsp;files&nbsp;instead&nbsp;of&nbsp;the&nbsp;original&nbsp;ones.</tt></dd></dl>
  56. </td></tr></table></td></tr></table>
  57. </body></html>