From dbf4559e14b71eeeddf70c2a8f5c3d0ec2c2ac00 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 3 Sep 2018 21:39:32 -0600 Subject: [PATCH] Adjusted image/map filenames * Partition filenames should include '_pX_' instead of just '_X_' * Trailing whitespace should be removed --- .bin/Scripts/functions/ddrescue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/ddrescue.py b/.bin/Scripts/functions/ddrescue.py index 2af666a0..31f22446 100644 --- a/.bin/Scripts/functions/ddrescue.py +++ b/.bin/Scripts/functions/ddrescue.py @@ -207,13 +207,17 @@ class DevObj(BaseObj): self.prefix = '{m_size}_{model}'.format( m_size=self.model_size, model=self.model) + self.prefix = self.prefix.strip() if self.parent: # Add child device details - self.prefix += '_{c_num}_{c_size}{sep}{c_label}'.format( - c_num=self.path.replace(self.parent, ''), + c_num = self.path.replace(self.parent, '') + self.prefix += '_{c_prefix}{c_num}_{c_size}{sep}{c_label}'.format( + c_prefix='p' if len(c_num) == 1 else '', + c_num=c_num, c_size=self.details.get('size', 'UNKNOWN'), sep='_' if self.label else '', c_label=self.label) + self.prefix = self.prefix.strip() class DirObj(BaseObj):