Skip to content

Commit 3fb77b9

Browse files
author
Tjaz Erzen
committed
Simplify printing full plain
1 parent 3db7289 commit 3fb77b9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

plain2code.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging.config
44
import os
55
import sys
6+
from pathlib import Path
67
from typing import Optional
78

89
import yaml
@@ -262,15 +263,10 @@ def main(): # noqa: C901
262263

263264
try:
264265
if args.full_plain:
265-
# Read the raw plain source file
266-
with open(args.filename, "r") as f:
267-
plain_source = f.read()
268-
266+
module_name = Path(args.filename).stem
267+
plain_source = plain_file.read_module_plain_source(module_name, template_dirs)
269268
[full_plain_source, _] = file_utils.get_loaded_templates(template_dirs, plain_source)
270-
271-
if args.verbose:
272-
console.info("Full plain text:\n")
273-
269+
console.info("Full plain text:\n")
274270
console.info(full_plain_source)
275271
return
276272

0 commit comments

Comments
 (0)