1234567891011121314151617181920212223242526272829303132333435363738394041 |
- def set():
- if not os.path.exists(settings.MEDIA_ROOT):
- try:
- os.mkdir(settings.MEDIA_ROOT)
- except OSError:
- return
- if not os.path.exists(settings.MEDIA_ROOT+'/download'):
- try:
- os.mkdir(settings.MEDIA_ROOT+'/download')
- except OSError:
- return
- if not os.path.exists(settings.BASE_DIR + "/log"):
- try:
- os.mkdir(settings.BASE_DIR + "/log")
- except OSError:
- return
- if not os.path.exists(settings.BASE_DIR + "/log/message"):
- try:
- os.mkdir(settings.BASE_DIR + "/log/message")
- except OSError:
- return
- if not os.path.exists(settings.BASE_DIR + "/log/error"):
- try:
- os.mkdir(settings.BASE_DIR + "/log/error")
- except OSError:
- return
- if not os.path.exists(settings.BASE_DIR + "/log/log"):
- try:
- os.mkdir(settings.BASE_DIR + "/log/log")
- except OSError:
- return
- if not os.path.exists(settings.MEDIA_ROOT + "/tgbot"):
- try:
- os.mkdir(settings.MEDIA_ROOT + "/tgbot")
- except OSError:
- return
|