pyminifier icon indicating copy to clipboard operation
pyminifier copied to clipboard

In any function if import some module next line it automatically add extra space

Open rakaseth opened this issue 3 years ago • 0 comments

Hi team,

Using pyminifier to obfuscate the python code.But in any function if i have import statement it is by default adding one extra space in next coming line. Example:

def deploy_model(self, poll_timeout=300):
    from zenml.integrations.seldon.model_deployers.seldon_model_deployer import (
        SeldonModelDeployer as modelDeployer
    )
    model_deployer = cast(
        modelDeployer, modelDeployer.get_active_model_deployer()
    )

After obfuscate the code: def mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROvXT(mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbRTOvj,poll_timeout=300): from zenml.integrations.seldon.model_deployers.seldon_model_deployer import(mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROjTX as modelDeployer) mWIJzelPyDpGMgsinKEUaSACrYBufoHQctwNkLxqhdVFbROjXT=modelDeployer.get_active_model_deployer

if we notice line start with 'from' and with 'mWIJ' has indentation issue.

i have ran command: pyminifier -O --replacement-length=50 --outfile filename.py filename.py

rakaseth avatar Nov 18 '22 10:11 rakaseth