Major refactor to make handling name/path manipulation easier.
Most of this is now in doom_base.py, which stores wad/map/name, exposes them as properties, and also takes care of most common tasks needed for building command lines and such.
This commit is contained in:
parent
85d3686f1c
commit
2438995093
11 changed files with 113 additions and 100 deletions
|
@ -10,9 +10,9 @@ class Thumb(dcc.doom_base.WadMap):
|
|||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
base = dcc.config.BaseThumbPath(parsed_args.wad, parsed_args.map, parsed_args.name)
|
||||
text = dcc.config.TextThumbPath(parsed_args.wad, parsed_args.map, parsed_args.name)
|
||||
mdoom = dcc.config.MDoomPath(parsed_args.wad)
|
||||
base = self.base_thumb_path()
|
||||
text = self.text_thumb_path()
|
||||
mdoom = self.m_doom_path()
|
||||
with wand.image.Image(filename=base) as bi, wand.color.Color("transparent") as tc:
|
||||
with wand.image.Image(filename=text) as ti:
|
||||
ti.border(tc, 5, 5)
|
||||
|
@ -27,4 +27,4 @@ class Thumb(dcc.doom_base.WadMap):
|
|||
di.border(tc, 1, 1)
|
||||
bi.composite(di, gravity="north_east")
|
||||
|
||||
bi.save(filename=dcc.config.ThumbPath(parsed_args.wad, parsed_args.map, parsed_args.name))
|
||||
bi.save(filename=self.thumb_path())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue