Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Icon?
ehthumbs.db
Thumbs.db

build
# Configuration files #
#######################
*.yaml
Expand All @@ -49,3 +49,5 @@ Thumbs.db
.project
.pydevproject
*.pyc
*~
.*.sw?
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include README.md
include CHANGELOG.md
include LICENSE
include VERSION
recursive-include proxypos/config *
recursive-include proxypos/init *
recursive-include proxypos/proxypos_core/controlers/logo *
recursive-include proxypos/templates/templates *
5 changes: 0 additions & 5 deletions proxypos-server

This file was deleted.

19 changes: 19 additions & 0 deletions proxypos/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013, Agustín Cruz Lozano.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 1 addition & 0 deletions proxypos/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.0
72 changes: 0 additions & 72 deletions proxypos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,72 +0,0 @@
# -*- encoding: utf-8 -*-
###########################################################################
# Copyright (c) 2013 OpenPyme - http://www.openpyme.mx/
# All Rights Reserved.
# Coded by: Agustín Cruz Lozano ([email protected])
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software") to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
##############################################################################

import os
import logging.config

import yaml

from bottle import run
from app import app


def setup_logging(
default_path='config/logging.yaml',
default_level=logging.INFO,
env_key='LOG_CFG'
):
"""Setup logging configuration

"""
path = default_path
value = os.getenv(env_key, None)
if value:
path = value
if os.path.exists(path):
with open(path, 'rt') as f:
config = yaml.load(f.read())
logging.config.dictConfig(config)
else:
logging.basicConfig(level=default_level)


def main():
# Set default configuration
port = '8069'
path = 'config/proxypos.yaml'
# Start logg
setup_logging()
# Interactive mode
logger = logging.getLogger(__name__)
logger.info("ProxyPos server starting up...")

if os.path.exists(path):
with open(path, 'rt') as f:
config = yaml.load(f.read())
port = config['port']

logger.info("Listening on http://%s:%s/" % ('localhost', port))
run(app, host='localhost', port=port, quiet=True)
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions proxypos/gtk-proxypos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python2

from proxypos import proxypos_core
from proxypos import gtkgui
#For local testing comment avobe lines
#uncoment below
#import proxypos_core
#import gtkgui

if __name__ == "__main__":
gtkgui.run(proxypos_core)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think will be better if we add a command line option allowing people to launch ProxyPoS with or without a graphical interface on a central way, as far as I understand currently there are two ways to launch ProxyPoS and I guess that will be confusing for users.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.- An installer for the application.

For this reason we have in our bin path two commands more gtk-proxypos.py and proxypos-server. If one user want to load the gui is shorter write gtk-proxypos than proxypos-server --gtk or something like that. But if is needed give the option to load the gui as an option, it can be added, and also can be added the option to load the config file from another location "--conf=path-to-config-files"

Also I was thinking add some kind of plugin/addon manager, to avoid mess up with the main code and separate the pricipipal API from the customizations. In one hand the core API, and in the other the addons/plugins. This can help in make more easy add functionalities/hardware and keep the main code more clean, even if many people wan't to make their own customizations.

As example:
What happend if I add a custom route to the POS, I need to edit app.py to add it, but is a functionality that, in some cases, I'm the only one that is going to use it.
What happend with an addon system? The server automatically look up for addons and load them. Even can be added the posibility read the addons that you need to load from OpenERP.

The more obvious is the print receipt function. What happend if I made an improvement on some other part of the main code that I wan't to merge with the main code, but I change this function. Represent a little more work for the main code mantainer.

Or even, What if I don't need to use the ESC/POS printer. Just think in the case I develop some hardware that let you find the products in the warehouse. Enter or scan the receipt and bring the products to you, or turn on some ligths that guide you to the products. Then why load the printer or template system?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think is the most idiomatic python solution (http://mundogeek.net/traducciones/python-idiomatico/)

1.- Add an option to set from command line the option to turn on/off graphical interface
2.- Keep the way you design using two different launch scripts

Loading