misc module¶
This is a storage for now useless pieces of code that used to be, or could be useful one day.
-
EOF_reader(path)[source]¶ Read a file until the EOF.
Warning
This is far too slow because tell() is bugged in python 2.x !
-
class
InputThread[source]¶ Bases:
threading.ThreadAn always waiting for input tread, printing what it gets.
-
class
Monitor(input_queue)[source]¶ Bases:
threading.ThreadA thread used to demonstrate how a queue object is working
-
random_local_URL(factor=2, max_depth=2)[source]¶ Returns: A random local URL Return type: string Warning
The repartition of the returned URL is not uniform ! ULR with 0-depth (ie ‘/’, with or without file name) are returned more often that longer URL. Use
uniform_random_local_URL_maker()to get auniform_random_local_URLfunction.Notes
number of section = len(section) * factormax_depthis the highest number possible of /section/subsection/subsubsection/etc./archive2/blog0/archive2/page1/ -> depth = 4Examples
/<- min_depth without URL_end/index.html<- min_depth with URL_end/page0//archive0/blog1//blog0/picture.png/page0/archive1/archive2/index.html/archive2/archive0/archive2/archive2/form.php<- max_depth = 4, with URL_end