[Piuparts-devel] [hpfn-d/piuparts_3] Deep copy get file dict (#14)]

Holger Levsen holger at layer-acht.org
Wed Feb 6 18:46:16 GMT 2019


----- Forwarded message from hpfn-d <notifications at github.com> -----

Date: Wed, 06 Feb 2019 10:16:08 -0800
From: hpfn-d <notifications at github.com>
To: hpfn-d/piuparts_3 <piuparts_3 at noreply.github.com>
Cc: Holger Levsen <holger at layer-acht.org>, Mention <mention at noreply.github.com>
Subject: [hpfn-d/piuparts_3] Deep copy get file dict (#14)
Reply-To: hpfn-d/piuparts_3
	<reply+00216bbfba97340151c575fccd1d34865224deed1cee0d8992cf000000011872e66892a169ce1847e77d at reply.github.com>
Message-ID: <hpfn-d/piuparts_3/pull/14 at github.com>
List-ID: hpfn-d/piuparts_3 <piuparts_3.hpfn-d.github.com>

Hi @h01ger ,

Two files. Do not write 'kprdcit = get_file_dict(same params)'
twice.  Use copy.deepcopy() to be safe. [Python 2 doc](https://docs.python.org/2/library/copy.html).

The patch ends here.

Then, if this is acceptable, my idea is to remove the last 
param from 'get_file_dict' function.

 - import only 'LOG_EXT'  for piuparts-report.py file.  Used in [line 1741](https://github.com/hpfn-d/piuparts_3/blob/master/piuparts-report.py#L1741). 

 - the detect_well_known_errors.py file will not need to import any *_EXT.

The 'get_file_dict' function and the last param are imported 
from piupartslib/dwke.py.

The 'get_file_dict' function should then be used as:

# detect_well_known_errors
logditc, kprdict, bugdict = get_file_dict(dirs)

# piuparts-report.py
logdict, kprdict, _ = get_file_dict(dirs)
You can view, comment on, or merge this pull request online at:

  https://github.com/hpfn-d/piuparts_3/pull/14

-- Commit Summary --

  * master-bin/detect_well_known_errors.py - good pratices for import
  * deepcopy - get_file_dict func

-- File Changes --

    M master-bin/detect_well_known_errors.py (13)
    M piuparts-report.py (7)

-- Patch Links --

https://github.com/hpfn-d/piuparts_3/pull/14.patch
https://github.com/hpfn-d/piuparts_3/pull/14.diff

-- 
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/hpfn-d/piuparts_3/pull/14

----- End forwarded message -----

-- 
tschau,
	Holger

-------------------------------------------------------------------------------
               holger@(debian|reproducible-builds|layer-acht).org
       PGP fingerprint: B8BF 5413 7B09 D35C F026 FE9D 091A B856 069A AA1C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20190206/24711344/attachment.sig>


More information about the Piuparts-devel mailing list