LogFly 1.5__tar.gz → 1.7__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,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logfly
3
- Version: 1.5
4
- Summary: Aa simple log tool by python
3
+ Version: 1.7
4
+ Summary: A simple log tool by python
5
5
  Home-page: https://about.guki.me
6
6
  Author: Yuan Sui
7
7
  Author-email: orisui@icloud.com
@@ -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.5
18
+ # logfly 1.7
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.5
1
+ # logfly 1.7
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,10 +5,10 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="logfly",
8
- version="1.5",
8
+ version="1.7",
9
9
  author="Yuan Sui",
10
10
  author_email="orisui@icloud.com",
11
- description="Aa simple log tool by python",
11
+ description="A simple log tool by python",
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
14
14
  url="https://about.guki.me",
@@ -1,15 +1,32 @@
1
1
  #####################
2
2
  # Author: Yuki Sui
3
- # Date: 2021-12-25
4
- # Version: 1.5
3
+ # Date: 2022-1-27
5
4
  #####################
6
5
 
7
6
  import time
7
+ import shutil
8
8
  import os
9
9
  from pathlib import Path
10
10
  from colorama import init
11
11
 
12
12
  init(autoreset=True)
13
+ __version__ = '1.7'
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') as filefiletemp:
26
+ filefiletemp.write('')
27
+ filefiletemp.close()
28
+ else:
29
+ pass
13
30
 
14
31
 
15
32
  def create_log_folder(folder_name, hidden):
@@ -40,8 +57,11 @@ def get_time(flag):
40
57
  return time.strftime("%H:%M:%S", time.localtime())
41
58
  elif flag == 'datetimefile':
42
59
  return time.strftime("%Y%m%d%H%M%S", time.localtime())
60
+ elif flag == 'timestamp':
61
+ return time.time()
43
62
 
44
63
 
64
+ # noinspection PyTypeChecker
45
65
  def write_log(name, position, level, message, mode='add',
46
66
  folder_name='logflys', hidden='no', color='yes', str_message='yes'):
47
67
  global LOGFILE, LOGFILE2, logfolder, logfolder_hidden, LOGFILE_hidden
@@ -142,13 +162,24 @@ def write_log(name, position, level, message, mode='add',
142
162
  error()
143
163
 
144
164
 
165
+ def mv_file(original_file_name, new_file_name, folder_name='mv_file'):
166
+ shutil.move(original_file_name, new_file_name)
167
+ message = 'File ' + original_file_name + ' moved to ' + new_file_name
168
+ write_log('logfly-log', 'CLI', 'error', message, folder_name=folder_name)
169
+
170
+
145
171
  def error():
146
172
  logflyErrorMessage = 'your parameter is wrong, please re-check it! \r\nAnd you can see the manual at ' \
147
173
  'https://github.com/tinqlo/logfly '
148
174
  write_log('logfly-log', 'CLI', 'error', logflyErrorMessage)
149
175
 
150
176
 
177
+ '''
151
178
  if __name__ == '__main__':
179
+ path = '.\\'
180
+ create_file(path, 'test.test')
181
+
182
+
152
183
  write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
153
184
  write_log('Doctor Who', 'CLI', 'warning', "this is Doctor's log, only in CLI.")
154
185
  write_log('Doctor Who', 'CLI', 'error', "this is Doctor's log, only in CLI.")
@@ -166,4 +197,4 @@ if __name__ == '__main__':
166
197
  write_log('Tardis', 'fileCLI', 'info', "this is Tardis's log, in file and CLI.", hidden='yes')
167
198
  write_log('Tardis', 'file', 'info', "this is Tardis's log, only in file.", hidden='yes')
168
199
  write_log('Death', 'fileCLI', 'info', "this is Death's log, in file and CLI.",
169
- mode='add', folder_name='death', hidden='yes')
200
+ mode='add', folder_name='death', hidden='yes')'''
@@ -0,0 +1,7 @@
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"""
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logfly
3
- Version: 1.5
4
- Summary: Aa simple log tool by python
3
+ Version: 1.7
4
+ Summary: A simple log tool by python
5
5
  Home-page: https://about.guki.me
6
6
  Author: Yuan Sui
7
7
  Author-email: orisui@icloud.com
@@ -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.5
18
+ # logfly 1.7
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,4 +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
9
+ src/logfly.egg-info/top_level.txt
10
+ src/logfly/soundfly/__init__.py
File without changes
File without changes
File without changes