initial commit for file_share plugin

This commit is contained in:
Jefry Lagrange
2012-10-28 14:45:00 -04:00
parent 511b37dd91
commit f9271e9809
8 changed files with 969 additions and 0 deletions

26
file_sharing/config.py Normal file
View File

@@ -0,0 +1,26 @@
import ConfigParser
import sys
import os
def set(option, value):
_file = open(path, 'w')
cp.set('General', option, value)
cp.write(_file)
_file.close()
def set_defaults():
cp.add_section('General')
set('incoming_dir', '/home')
path = sys.path[1]
path = path + '/file_sharing/' + 'conf.cfg'
cp = ConfigParser.ConfigParser()
if os.path.exists(path):
_file = open(path)
cp.readfp(_file)
_file.close()
else:
set_defaults()
INCOMING_DIR = cp.get('General', 'incoming_dir')