1

my code snippet is below :

import htmlmin

descc=mbo.getString("DESCRIPCION_LONGDESCRIPTION")

LONGDESCRIPTION=mbo.getMboSet("REP_LONGDESC")

if LONGDESCRIPTION is not None: longMbot=LONGDESCRIPTION.getMbo(0) ldtext=longMbot.getString("LDTEXT")

ldtextcode= htmlmin.minify(ldtext, remove_empty_space=True)

print len(ldtextcode)
print 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
print "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmk"
if len(ldtextcode)>32000:
   errorgroup = "catalizadores"
   errorkey = "ITEM_Check"

I am getting the error like ImportError: No module named htmlmin i

A.Bond
  • 43
  • 1
  • 6

1 Answers1

1

The htmlmin module doesn't appear to be included in the Jython implementation included with Maximo out of the box. There's no module I could find included with Jython that I'm aware could do this for you.

You could potentially code something to do this yourself or provide some additional detail around what you're trying to achieve in your question here and someone else may be able to help you with that. It's not clear from your question why you're looking to minify the contents of the long description. htmlmin would compress the html markup in an html file to reduce/remove whitespace, etc. in the markup itself, leaving the content untouched but the file smaller to download. I'm not clear how this fits with the content in the long description field in Maximo.

It may be possible to download the Python package archive file for htmlmin from the following url then include it in your environment however I wasn't able to locate a source explaining a workable solution to doing that, but your mileage may vary.

https://pypi.org/project/htmlmin/#files

https://www.maximoscripting.com/using-external-libraries-in-jython/

Maximo.Wiki
  • 631
  • 5
  • 17