| Conditions | 5 |
| Total Lines | 11 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 12 | def write_dump(self, data): |
||
| 13 | outfile = os.path.normpath("logs/{}.xml".format(self.get_salt())) |
||
| 14 | if not os.path.exists(os.path.dirname(outfile)): |
||
| 15 | try: |
||
| 16 | os.makedirs(os.path.dirname(outfile)) |
||
| 17 | except OSError as e: |
||
| 18 | if e.errno != errno.EEXIST: |
||
| 19 | raise |
||
| 20 | with open(outfile, "w", encoding="utf-8") as f: |
||
| 21 | f.write(data) |
||
| 22 | self.last_dump_filename = outfile |
||
| 23 | |||
| 38 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.