blob: af6f60e70b0e8eebe27e40c2cab0864d03e78987 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/usr/bin/python
import sys
import os
import time
import string
import sha
BASE_DIR = "/var/www/asdf.us/httpdocs/im/"
OTHER_BASE = "http://asdf.us/im/"
#THIS MODULE RETURNS A COMPLETE PATH! ALL YOU HAVE TO DO IS
#SPECIFY THE BASE DIRECTORY
#the hash works like this:
#0 is private path
#1 is the public path
def hash_dir (s):
return sha.new(s).hexdigest()[:2]
def now ():
return int(time.mktime(time.localtime()))
def hexdir():
time = now()
time = str(time)
ending = hash_dir(time)
dirs = []
dirs.append(BASE_DIR+ending+'/')
dirs.append(OTHER_BASE+ending+'/')
print str(dirs)
return dirs
sys.exit()
if __name__ == "__main__":
hexdir()
|