Skip to content

Commit

Permalink
ugh forgot to copy paste from dev_src. V0.6.3 coming up
Browse files Browse the repository at this point in the history
  • Loading branch information
RaSan147 committed Jan 22, 2023
1 parent 02bf25b commit c1765e5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 0.6.3
## Client-side Changes:
* Nothing to notice
## Server-side Changes:
* HOTFIX: log_message now works like print funtion (*args), not like logger.log(format, *args)
## Fixes:
* fixed log_message not working


------------------------------------------------------------------------

# Version 0.6.2
## Client-side Changes:
* Nothing to notice
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2
0.6.3
2 changes: 1 addition & 1 deletion dev_src/local_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__version__ = "0.6.1"
__version__ = "0.6.3"
enc = "utf-8"
__all__ = [
"HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyrobox
version = 0.6.2
version = 0.6.3
authors = Rasan
author_email= wwwqweasd147@gmail.com
description = Personal DropBox for Private Network
Expand Down
35 changes: 14 additions & 21 deletions src/server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__version__ = "0.6.1"
__version__ = "0.6.3"
enc = "utf-8"
__all__ = [
"HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler",
Expand Down Expand Up @@ -1276,8 +1276,7 @@ def log_request(self, code='-', size='-'):
"""
if isinstance(code, HTTPStatus):
code = code.value
self.log_message('"%s" %s %s',
self.requestline, str(code), str(size))
self.log_message(f'"{self.requestline}"', code, size)

def log_error(self, *args):
"""Log an error.
Expand All @@ -1290,45 +1289,35 @@ def log_error(self, *args):
XXX This should go to the separate error log.
"""
msg = " ".join(map(str, args))
self.log_message(msg, error = True)
self.log_message(args, error = True)

def log_warning(self, *args):
"""Log a warning"""
msg = " ".join(map(str, args))
self.log_message(msg, warning = True)
self.log_message(args, warning = True)

def log_debug(self, *args):
"""Log a debug message"""
msg = " ".join(map(str, args))
self.log_message(msg, debug = True)
self.log_message(args, debug = True)

def log_info(self, *args):
"""Default log"""
msg = " ".join(map(str, args))
self.log_message(msg)
self.log_message(args)




def log_message(self, format, *args, error = False, warning = False, debug = False):
def log_message(self, *args, error = False, warning = False, debug = False):
"""Log an arbitrary message.
This is used by all other logging functions. Override
it if you have specific logging wishes.
The first argument, FORMAT, is a format string for the
message to be logged. If the format string contains
any % escapes requiring parameters, they should be
specified as subsequent arguments (it's just like
printf!).
The client ip and current date/time are prefixed to
every message.
"""

message = format % args
message = ' '.join(map(str, args))

message = ("# %s by [%s] at [%s] %s\n" %
(self.req_hash, self.address_string(),
Expand Down Expand Up @@ -4945,14 +4934,18 @@ def run(port = None, directory = None, bind = None, arg_parse= True):
default=config.port, type=int,
nargs='?',
help='Specify alternate port [default: 8000]')
parser.add_argument('--version', '-v', action='version',
version=__version__)

args = parser.parse_args()

port = args.port
directory = args.directory
bind = args.bind


print(tools.text_box("Running File: ", config.MAIN_FILE))

print(tools.text_box("Running File: ", config.MAIN_FILE, "Version: ", __version__))



if directory == config.ftp_dir and not os.path.isdir(config.ftp_dir):
Expand Down

0 comments on commit c1765e5

Please sign in to comment.