Changeset 462 in main


Ignore:
Timestamp:
11/09/11 17:23:27 (8 years ago)
Author:
pcosquer
Message:

navigate: generate random image path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/navigate.py

    r392 r462  
    2929 
    3030import os 
     31import string 
     32import random 
    3133import warnings 
    3234import cStringIO as StringIO 
     
    384386        self.graph = FrozenAGraph(s) 
    385387 
    386         t = "p" if isinstance(self.object, PLMObjectController) else "u" 
    387         picture_path = "media/navigate/" + t + str(self.object.id) + "-" 
    388         for opt in self.options_list: 
    389             picture_path += str(int(self.options[opt])) 
     388        rand = "".join(random.choice(string.ascii_lowercase) for x in xrange(40)) 
     389        picture_path = "media/navigate/" + rand 
    390390        prog = self.options.get("prog", "dot") 
    391391        self.graph.layout(prog=prog) 
Note: See TracChangeset for help on using the changeset viewer.