diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-02-13 02:42:02 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-02-13 02:42:02 -0800 |
| commit | fd640b170a64584fd9c295be53c91972ff9f9ec1 (patch) | |
| tree | c67e95b332e183bbf14065bba55dd77e86a71fbe /im/cgi-bin/imweb/hexdirer.py | |
| parent | 64f41d53728a966f10aef6d7ffbc00853d754300 (diff) | |
fixed some basics
Diffstat (limited to 'im/cgi-bin/imweb/hexdirer.py')
| -rwxr-xr-x | im/cgi-bin/imweb/hexdirer.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/im/cgi-bin/imweb/hexdirer.py b/im/cgi-bin/imweb/hexdirer.py new file mode 100755 index 0000000..af6f60e --- /dev/null +++ b/im/cgi-bin/imweb/hexdirer.py @@ -0,0 +1,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() + |
