LogFly 1.6__tar.gz → 1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logfly
3
- Version: 1.6
3
+ Version: 1.8
4
4
  Summary: A simple log tool by python
5
5
  Home-page: https://about.guki.me
6
6
  Author: Yuan Sui
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
 
18
- # logfly 1.6
18
+ # logfly 1.8
19
19
  ### a simple log tool by python
20
20
 
21
21
  ## position
@@ -25,7 +25,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
25
25
  ## How to
26
26
  ### import
27
27
  import logfly
28
- ### use
28
+ ### use1
29
29
  logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes', str_message='yes')
30
30
 
31
31
  ## Description
@@ -43,6 +43,13 @@ if use hidden, log will also appear in user/.1o9f1y folder
43
43
  color: ('yes', 'no') default is 'yes', means log will with color.
44
44
  str_message: ('yes', 'no') default is 'yes', means log will print message with str()
45
45
 
46
+ ###use2
47
+ logfly.create_file(pathfile='', filenname='')
48
+
49
+ ##Description
50
+ pathfile is the file path that you want to create, must fill with //
51
+ filenname is the file name that you want to create, must is with *.*
52
+
46
53
  ## Example:
47
54
 
48
55
  ### both file and CLI code
@@ -1,4 +1,4 @@
1
- # logfly 1.6
1
+ # logfly 1.8
2
2
  ### a simple log tool by python
3
3
 
4
4
  ## position
@@ -8,7 +8,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
8
8
  ## How to
9
9
  ### import
10
10
  import logfly
11
- ### use
11
+ ### use1
12
12
  logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes', str_message='yes')
13
13
 
14
14
  ## Description
@@ -26,6 +26,13 @@ if use hidden, log will also appear in user/.1o9f1y folder
26
26
  color: ('yes', 'no') default is 'yes', means log will with color.
27
27
  str_message: ('yes', 'no') default is 'yes', means log will print message with str()
28
28
 
29
+ ###use2
30
+ logfly.create_file(pathfile='', filenname='')
31
+
32
+ ##Description
33
+ pathfile is the file path that you want to create, must fill with //
34
+ filenname is the file name that you want to create, must is with *.*
35
+
29
36
  ## Example:
30
37
 
31
38
  ### both file and CLI code
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="logfly",
8
- version="1.6",
8
+ version="1.8",
9
9
  author="Yuan Sui",
10
10
  author_email="orisui@icloud.com",
11
11
  description="A simple log tool by python",
@@ -23,4 +23,5 @@ setuptools.setup(
23
23
  package_dir={"": "src"},
24
24
  packages=setuptools.find_packages(where="src"),
25
25
  python_requires=">=3.6",
26
+ install_requires=['colorama']
26
27
  )
@@ -1,6 +1,6 @@
1
1
  #####################
2
2
  # Author: Yuki Sui
3
- # Date: 2022-1-16
3
+ # Date: 2022-1-30
4
4
  #####################
5
5
 
6
6
  import time
@@ -10,7 +10,23 @@ from pathlib import Path
10
10
  from colorama import init
11
11
 
12
12
  init(autoreset=True)
13
- __version__ = '1.6'
13
+ __version__ = '1.8'
14
+
15
+
16
+ def create_file(pathfile='', filenname=''):
17
+ if pathfile is None:
18
+ return False
19
+ if not os.path.exists(pathfile):
20
+ os.makedirs(pathfile)
21
+ else:
22
+ pass
23
+ filepath = pathfile + filenname
24
+ if not os.path.isfile(filepath):
25
+ with open(filepath, 'w', encoding='utf-8') as filefiletemp:
26
+ filefiletemp.write('')
27
+ filefiletemp.close()
28
+ else:
29
+ pass
14
30
 
15
31
 
16
32
  def create_log_folder(folder_name, hidden):
@@ -87,21 +103,21 @@ def write_log(name, position, level, message, mode='add',
87
103
  error()
88
104
  elif position == 'file':
89
105
  if mode == 'add':
90
- File = open(LOGFILE, 'a', newline='')
106
+ File = open(LOGFILE, 'a', newline='', encoding='utf-8')
91
107
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
92
108
  File.close()
93
109
  if hidden == 'yes':
94
110
  LOGFILE2 = logfolder_hidden + LOGFILE_hidden
95
- File = open(LOGFILE2, 'a', newline='')
111
+ File = open(LOGFILE2, 'a', newline='', encoding='utf-8')
96
112
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
97
113
  File.close()
98
114
  elif mode == 'new':
99
- File = open(LOGFILE, 'w', newline='')
115
+ File = open(LOGFILE, 'w', newline='', encoding='utf-8')
100
116
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
101
117
  File.close()
102
118
  if hidden == 'yes':
103
119
  LOGFILE2 = logfolder_hidden + LOGFILE_hidden
104
- File = open(LOGFILE2, 'a', newline='')
120
+ File = open(LOGFILE2, 'a', newline='', encoding='utf-8')
105
121
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
106
122
  File.close()
107
123
  else:
@@ -123,21 +139,21 @@ def write_log(name, position, level, message, mode='add',
123
139
  else:
124
140
  error()
125
141
  if mode == 'add':
126
- File = open(LOGFILE, 'a', newline='')
142
+ File = open(LOGFILE, 'a', newline='', encoding='utf-8')
127
143
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
128
144
  File.close()
129
145
  if hidden == 'yes':
130
146
  LOGFILE2 = logfolder_hidden + LOGFILE_hidden
131
- File = open(LOGFILE2, 'a', newline='')
147
+ File = open(LOGFILE2, 'a', newline='', encoding='utf-8')
132
148
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
133
149
  File.close()
134
150
  elif mode == 'new':
135
- File = open(LOGFILE, 'w', newline='')
151
+ File = open(LOGFILE, 'w', newline='', encoding='utf-8')
136
152
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
137
153
  File.close()
138
154
  if hidden == 'yes':
139
155
  LOGFILE2 = logfolder_hidden + LOGFILE_hidden
140
- File = open(LOGFILE2, 'a', newline='')
156
+ File = open(LOGFILE2, 'a', newline='', encoding='utf-8')
141
157
  File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
142
158
  File.close()
143
159
  else:
@@ -159,21 +175,4 @@ def error():
159
175
 
160
176
 
161
177
  if __name__ == '__main__':
162
- write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
163
- write_log('Doctor Who', 'CLI', 'warning', "this is Doctor's log, only in CLI.")
164
- write_log('Doctor Who', 'CLI', 'error', "this is Doctor's log, only in CLI.")
165
- write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.", mode='add')
166
- write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
167
- write_log('Tardis', 'CLI', 'info', "this is Tardis's log, only in CLI.")
168
- write_log('Tardis', 'fileCLI', 'info', "this is Tardis's log, in file and CLI.")
169
- write_log('Tardis', 'file', 'info', "this is Tardis's log, only in file.")
170
- write_log('Death', 'fileCLI', 'info', "this is Death's log, in file and CLI.", mode='add', folder_name='death')
171
-
172
- write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.", hidden='yes')
173
- write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.", mode='add', hidden='yes')
174
- write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", hidden='yes')
175
- write_log('Tardis', 'CLI', 'info', "this is Tardis's log, only in CLI.", hidden='yes')
176
- write_log('Tardis', 'fileCLI', 'info', "this is Tardis's log, in file and CLI.", hidden='yes')
177
- write_log('Tardis', 'file', 'info', "this is Tardis's log, only in file.", hidden='yes')
178
- write_log('Death', 'fileCLI', 'info', "this is Death's log, in file and CLI.",
179
- mode='add', folder_name='death', hidden='yes')
178
+ write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, only in CLI.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logfly
3
- Version: 1.6
3
+ Version: 1.8
4
4
  Summary: A simple log tool by python
5
5
  Home-page: https://about.guki.me
6
6
  Author: Yuan Sui
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
 
18
- # logfly 1.6
18
+ # logfly 1.8
19
19
  ### a simple log tool by python
20
20
 
21
21
  ## position
@@ -25,7 +25,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
25
25
  ## How to
26
26
  ### import
27
27
  import logfly
28
- ### use
28
+ ### use1
29
29
  logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes', str_message='yes')
30
30
 
31
31
  ## Description
@@ -43,6 +43,13 @@ if use hidden, log will also appear in user/.1o9f1y folder
43
43
  color: ('yes', 'no') default is 'yes', means log will with color.
44
44
  str_message: ('yes', 'no') default is 'yes', means log will print message with str()
45
45
 
46
+ ###use2
47
+ logfly.create_file(pathfile='', filenname='')
48
+
49
+ ##Description
50
+ pathfile is the file path that you want to create, must fill with //
51
+ filenname is the file name that you want to create, must is with *.*
52
+
46
53
  ## Example:
47
54
 
48
55
  ### both file and CLI code
@@ -6,5 +6,5 @@ src/logfly/__init__.py
6
6
  src/logfly.egg-info/PKG-INFO
7
7
  src/logfly.egg-info/SOURCES.txt
8
8
  src/logfly.egg-info/dependency_links.txt
9
- src/logfly.egg-info/top_level.txt
10
- src/logfly/soundfly/__init__.py
9
+ src/logfly.egg-info/requires.txt
10
+ src/logfly.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ colorama
@@ -1,7 +0,0 @@
1
- # Sound analysis lib
2
- # Author: Yuan Sui
3
- # Date: 2022-1-16
4
- # TODO: add code. may add wav file wave,
5
- # spectrum and limit check(displayed via matplotlib) --Yuan
6
-
7
- """I love you, Pidan"""
File without changes
File without changes
File without changes