-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from DavidCEllis/rewrite_settings
Complete write of server, convert settings to attrs
- Loading branch information
Showing
16 changed files
with
179 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from splitnotes2.server import app, get_notes, settings | ||
import flask.cli as cli | ||
|
||
# Stop flask from giving users an unhelpful warning. | ||
cli.show_server_banner = lambda *x: None | ||
|
||
|
||
def launch(): | ||
get_notes() # Sets internal 'notes' and 'notefile' variables | ||
|
||
print( | ||
"This server version of Splitnotes2 allows you view splitnotes via a browser window " | ||
"and should work across a local network.\n" | ||
"It is not intended to be used over the internet and as such is not based on a " | ||
"production server." | ||
) | ||
|
||
print( | ||
f"Connect a browser to http://{settings.server_hostname}:{settings.server_port}/ " | ||
f"in order to view the notes." | ||
) | ||
|
||
print(f"This hostname and port can be changed in {settings.output_file} if needed.") | ||
|
||
app.run(threaded=True, host=settings.server_hostname, port=settings.server_port) | ||
|
||
|
||
if __name__ == "__main__": | ||
launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .split_server import app, get_notes, settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.