Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.

83 wiersze
5.6KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: module ktt.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><a href="ktt.html"><font color="#ffffff">ktt</font></a>.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:/home/kaisd/Мастерская/projects/KTT/ktt/atr.py">/home/kaisd/Мастерская/projects/KTT/ktt/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="__builtin__.html#object">__builtin__.object</a>
  30. </font></dt><dd>
  31. <dl>
  32. <dt><font face="helvetica, arial"><a href="ktt.atr.html#ATR">ATR</a>
  33. </font></dt></dl>
  34. </dd>
  35. </dl>
  36. <p>
  37. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  38. <tr bgcolor="#ffc8d8">
  39. <td colspan=3 valign=bottom>&nbsp;<br>
  40. <font color="#000000" face="helvetica, arial"><a name="ATR">class <strong>ATR</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
  41. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  42. <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>
  43. in&nbsp;the&nbsp;content&nbsp;or&nbsp;names&nbsp;of&nbsp;text&nbsp;file.<br>
  44. 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>
  45. <tr><td>&nbsp;</td>
  46. <td width="100%">Methods defined here:<br>
  47. <dl><dt><a name="ATR-__init__"><strong>__init__</strong></a>(self, files)</dt><dd><tt>Constructor</tt></dd></dl>
  48. <dl><dt><a name="ATR-clear_replacements"><strong>clear_replacements</strong></a>(self)</dt><dd><tt>Removes&nbsp;all&nbsp;replacements.</tt></dd></dl>
  49. <dl><dt><a name="ATR-log"><strong>log</strong></a>(self, string)</dt><dd><tt>Print&nbsp;information</tt></dd></dl>
  50. <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>
  51. <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>
  52. you&nbsp;can&nbsp;use&nbsp;it&nbsp;with&nbsp;writeNewFiles()&nbsp;method.</tt></dd></dl>
  53. <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>
  54. Valid&nbsp;values&nbsp;for&nbsp;keyFormat:<br>
  55. 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>
  56. fullname&nbsp;-&nbsp;as&nbsp;filename,&nbsp;but&nbsp;with&nbsp;path.<br>
  57. 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>
  58. 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>
  59. <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>
  60. <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>
  61. <hr>
  62. Data descriptors defined here:<br>
  63. <dl><dt><strong>__dict__</strong></dt>
  64. <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
  65. </dl>
  66. <dl><dt><strong>__weakref__</strong></dt>
  67. <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
  68. </dl>
  69. </td></tr></table></td></tr></table>
  70. </body></html>