Fred Z
a30fd9c412
Fix bugged requirements.txt
2018-09-26 14:18:57 +02:00
Fred Z
a9c3c2c480
Updates comments
2018-08-09 13:22:36 +02:00
Fred Z
3e252bd918
Updates approach.md
2018-08-09 13:17:18 +02:00
Fred Z
f63322d490
Fixes a bug when item list has only one item
2018-08-09 02:21:01 +02:00
Fred Z
38c398627b
Adds multipage API request in 'get_category()' #11
2018-08-09 02:21:01 +02:00
Fred Z
3ee663d173
Updates approach.md
2018-08-09 02:21:01 +02:00
Fred Z
a02f8e7f7b
Updates documentation.md
2018-08-09 02:21:01 +02:00
Fred Z
a99415e07b
Fixes a typo-cat-trace
2018-08-08 22:05:25 +02:00
Fred Z
47bf7a6146
Adds init menu & saved substitutes list #5
2018-08-08 17:53:11 +02:00
Fred Z
f77c7ad09d
Changes 'quit message' mgmt & product selection #5
2018-08-08 11:07:19 +02:00
Fred Z
2aa2f73dd7
Saves (or not) substitutes selected by user #5
2018-08-08 10:58:42 +02:00
Fred Z
6c67b01164
Formates better the lists (prod/cat/sub) #5
...
- Truncates the name in the 2 column menu (but keep full name in others places)
2018-08-07 23:38:00 +02:00
Fred Z
18107a065f
Strengthens SQL requests #5
...
- Use 'id' to select
- Adds NOT NULL for product to avoid absurd substitut request
2018-08-07 23:11:15 +02:00
Fred Z
c112134f0b
Adds detailled description for substitute prod #5
2018-08-07 22:58:20 +02:00
Fred Z
ce7a300b25
Clarifies messaging #5
...
FIX : clarify messaging (CF 'WTF' strings)
2018-08-07 22:58:20 +02:00
Fred Z
e88592bf4e
Adds the substitute list & user input #5
...
- Reformates code to improve readability
- Renames 3rd field of SELECT request option to harmonize data processing
- TODO : clarify messaging (CF 'WTF' strings)
2018-08-07 22:58:20 +02:00
Fred Z
f9dd7d4ed6
Adds the product list & user input #5
2018-08-07 22:57:34 +02:00
Fred Z
0dc050f23d
Exports uses input in 'ask_user()' function #5
2018-08-07 02:40:49 +02:00
Fred Z
bf4ac6738a
Exports list generation in a function #5
...
- function 'get_data_list()' will be used for products either
- changed some constant/variables name for better comprehension
2018-08-07 00:12:06 +02:00
Fred Z
840edb4f40
Validates the user typing and prepares sequel #5
...
- adds index range
- adds quit option
- makes code compliant with pylint & flake8
2018-08-06 20:15:44 +02:00
Fred Z
dadbca63ff
Writes up script to step : 'Ask cat index' #5
2018-08-04 22:44:52 +02:00
Fred Z
291f4d0199
Adds SQL requests needed by CLI #5
2018-08-04 18:40:34 +02:00
Fred Z
87199cd4c0
Creates CLI skeleton with comments #5
2018-08-04 17:49:16 +02:00
Fred Z
ca0ab595b3
Adds script to populates local DB #4 #6
2018-08-04 16:42:04 +02:00
Fred Z
48b13e52fd
Fixes 'sql_generator()' if category do not exists
2018-08-04 16:42:04 +02:00
Fred Z
091dfffc76
Fixes 'sql_generator()' when nutriscore is False
...
- edits request string before returning it
- adds 'false_to_null()' method
- adds & updates tests
2018-08-04 16:40:42 +02:00
Fred Z
b18a7062ca
Wraps method 'pymysql…execute()', adds 'autocommit'
2018-08-03 18:23:26 +02:00
Fred Z
5d5646ca9d
Strengthens the Db() class
...
- Adds 2 'connection' attributes 'self.cnx' & 'self.cursor'
- Adds some tests
- TODO : Find how to test if connection is broken
- Renames 'cnx()' method to 'start_connexion()'
2018-08-03 18:11:08 +02:00
Fred Z
f345078091
Fixes syntax to prevent MySQL error
...
- double quotes because some product names haves single quotes inside
- semi colon trailing in request
2018-08-03 17:16:15 +02:00
Fred Z
7d1f4418db
Adds 'db_summary()' method
...
To lighten and improve the __init__
Now it can be re-called after the create-DB script
Exports messages template in 'config.py'
PyMysql seem not to accept 'CREATE TABLE IF NOT EXIST'
2018-08-03 00:41:17 +02:00
Fred Z
192e18d8e0
Refactors DB access
2018-08-02 20:00:30 +02:00
Fred Z
564cf0a1e6
Moves sample files in dedicated directory
2018-08-02 11:41:58 +02:00
Fred Z
3dba82fde5
Updates documentation.md
2018-08-02 11:29:42 +02:00
Fred Z
ab774bbc85
Updates .gitignore
2018-08-02 11:20:51 +02:00
Fred Z
9f81f0f7cf
Renames file
2018-08-02 11:20:51 +02:00
Fred Z
24e461fb70
Adds 'sql_generator()' #4
2018-08-02 11:20:51 +02:00
Fred Z
f5b75c7282
Adds optionnal local file work for 'get_product()'
2018-08-02 11:20:51 +02:00
Fred Z
5948a17d77
Adds url fiels in 'get_product()'
2018-08-02 11:20:51 +02:00
Fred Z
01557cf9ae
Adds a category field in 'get_category()'
2018-08-02 11:20:51 +02:00
Fred Z
9721a62951
Picks 1 cat to associate w/ product in local DB #4
2018-08-02 11:20:51 +02:00
Fred Z
3ffbcfa208
Adds messaging & stats features #4
2018-08-02 11:20:51 +02:00
Fred Z
005a25afc5
Adds developpement requests (INSERT & DB size) #2
2018-08-02 11:20:51 +02:00
Fred Z
ae687d85ac
Updates SQL for DB creation script #2
...
- Adds UNIQUE KEY
- Deletes association table
- Adds product's url
2018-08-01 18:24:32 +02:00
Fred Z
a900bca119
Updates physical data model #2
2018-07-31 15:51:03 +02:00
Fred Z
1c17468fb2
Generates dict with prod & fields #4
...
- Modifies the storage of kept fields : need to keep more fields from a category
than from a product FIELD_KEPT is turned into a dict like this :
{'category':[fields, …], 'products':[fields, …]}
- separates online/offline tests
2018-07-31 15:28:56 +02:00
Fred Z
08f1227c01
Adds optionnal local file work for get_category()
2018-07-30 08:13:36 +02:00
Fred Z
ca821728ae
Packs database script in a class
...
Adds little tests
2018-07-30 07:25:21 +02:00
Fred Z
cff82380b8
Exports config in a new file 'config.py'
2018-07-27 22:27:42 +02:00
Fred Z
1c868d21c0
Adds test wrong file to 'sql_create_db()'
2018-07-27 22:14:53 +02:00
Fred Z
c392d1772d
Creates DB if not exist #4
2018-07-27 18:46:33 +02:00