11# -*- coding:utf-8 -*-
22
3- import os
3+ import datetime
44# import logging
5+ import os
56import time
6- import datetime
7+
8+ from deprecated import deprecated
79
810
11+ @deprecated (
12+ version = '0.0.2.dev1' ,
13+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
14+ this method after extending 2-3 versions" )
915def generate_complex_file_name (output_dir_name , file_name ):
1016 'the generate complex file name'
1117 output_dir = mk_output_dir (output_dir_name )
1218 name = str ("%s_%s.log" % (file_name , int (time .time ())))
1319 return os .path .join (output_dir , name )
1420
1521
22+ @deprecated (
23+ version = '0.0.2.dev1' ,
24+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
25+ this method after extending 2-3 versions" )
1626def generate_fmt_file_name (output_dir_name , file_name , fmt = '%Y%m%d_%H%M%S' ):
1727 'the generate out with fmt file name'
1828 output_dir = mk_output_dir (output_dir_name )
19- name = str ("%s_%s.txt" %
20- (file_name , datetime .datetime .now ().strftime (fmt )))
29+ name = str ("%s_%s.txt" % (file_name , datetime .datetime .now ().strftime (fmt )))
2130 return os .path .join (output_dir , name )
2231
2332
33+ @deprecated (
34+ version = '0.0.2.dev1' ,
35+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
36+ this method after extending 2-3 versions" )
2437def generate_file_name (output_dir_name , file_name ):
2538 'the generate out file name'
2639 output_dir = mk_output_dir (output_dir_name )
2740 return os .path .join (output_dir , file_name )
2841
2942
43+ @deprecated (
44+ version = '0.0.2.dev1' ,
45+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
46+ this method after extending 2-3 versions" )
3047def generate_file_name_only (output_dir_name , file_name ):
3148 'the generate file name only'
3249 output_dir = mk_dir (output_dir_name )
3350 return os .path .join (output_dir , file_name )
3451
3552
36- def generate_complex_or_fmt_file_name (output_dir_name ,
37- file_name ,
38- fmt = '%Y%m%d_%H%M%S' ):
53+ @deprecated (
54+ version = '0.0.2.dev1' ,
55+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
56+ this method after extending 2-3 versions" )
57+ def generate_complex_or_fmt_file_name (output_dir_name , file_name , fmt = '%Y%m%d_%H%M%S' ):
3958 'the generate out complex or fmt file name'
4059 output_dir = mk_output_dir (output_dir_name )
4160 if file_name is None or len (file_name .strip ()) == 0 :
@@ -44,15 +63,17 @@ def generate_complex_or_fmt_file_name(output_dir_name,
4463 if '.' in file_name :
4564 rdot_index = file_name .rfind ('.' )
4665 if rdot_index > 0 :
47- file_name = str ("%s_%s%s" % (file_name [0 :rdot_index ],
48- datetime .datetime .now ().strftime (fmt ),
49- file_name [rdot_index :]))
66+ file_name = str ("%s_%s%s" %
67+ (file_name [0 :rdot_index ], datetime .datetime .now ().strftime (fmt ), file_name [rdot_index :]))
5068 else :
51- file_name = str ("%s_%s" %
52- (file_name , datetime .datetime .now ().strftime (fmt )))
69+ file_name = str ("%s_%s" % (file_name , datetime .datetime .now ().strftime (fmt )))
5370 return os .path .join (output_dir , file_name )
5471
5572
73+ @deprecated (
74+ version = '0.0.2.dev1' ,
75+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
76+ this method after extending 2-3 versions" )
5677def mk_dir (output_dir_name ):
5778 'the initialize global output dir'
5879 project_dir = os .path .abspath ('.' )
@@ -62,6 +83,10 @@ def mk_dir(output_dir_name):
6283 return output_dir
6384
6485
86+ @deprecated (
87+ version = '0.0.2.dev1' ,
88+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
89+ this method after extending 2-3 versions" )
6590def mk_output_dir (output_dir_name ):
6691 'the initialize output dir'
6792 # root_dir = os.path.dirname(os.path.abspath('.'))
@@ -79,6 +104,10 @@ def mk_output_dir(output_dir_name):
79104 return output_dir
80105
81106
107+ @deprecated (
108+ version = '0.0.2.dev1' ,
109+ reason = "You should use the from com.dvsnier.directory.common_directory import CommonDirectory, that We will delete \
110+ this method after extending 2-3 versions" )
82111def mk_children_dir (output_dir_name , sub_dir_name ):
83112 'the initialize children dir'
84113 if not os .path .exists (output_dir_name ):
0 commit comments