Skip to content

Commit

Permalink
be flexible about obfuscations with nolatin
Browse files Browse the repository at this point in the history
  • Loading branch information
hiaselhans committed Jan 26, 2015
1 parent 031484b commit 6222d43
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pyminifier/pyminifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,17 @@ def main():
except Exception as err:
print("Error reading %s:" % options.prepend)
print(err)
# Automatically enable --obfuscate if --nonlatin (it's implied)
if options.use_nonlatin:

obfuscations = (options.obfuscate, options.obf_classes,
options.obf_functions, options.obf_variables,
options.obf_builtins, options.obf_import_methods)

# Automatically enable obfuscation if --nonlatin (implied if no explicit obfuscation is stated)
if options.use_nonlatin and not any(obfuscations):
options.obfuscate = True
if len(args) > 1: # We're dealing with more than one file
name_generator = None # So we can tell if we need to obfuscate
if options.obfuscate or options.obf_classes \
or options.obf_functions or options.obf_variables \
or options.obf_builtins or options.obf_import_methods:
if any(obfuscations):
# Put together that will be used for all obfuscation functions:
identifier_length = int(options.replacement_length)
if options.use_nonlatin:
Expand Down

0 comments on commit 6222d43

Please sign in to comment.