| Total Complexity | 1 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #This file create a SQLite local database for CNBP requirement. |
||
| 2 | #Creation: 2018-07-11T160228EST |
||
| 3 | #Author: Yang Ding |
||
| 4 | |||
| 5 | import os |
||
| 6 | from dotenv import load_dotenv |
||
| 7 | from LocalDB.create import LocalDBCreate |
||
| 8 | from LocalDB import schema |
||
| 9 | |||
| 10 | |||
| 11 | def create_localDB_CNBP(Path): |
||
| 12 | |||
| 13 | # name of the TableName to be created |
||
| 14 | |||
| 15 | |||
| 16 | #Create the PRIMARY KEY column. |
||
| 17 | |||
| 18 | |||
| 19 | load_dotenv() |
||
| 20 | |||
| 21 | username = os.getenv("LORISusername") |
||
| 22 | password = os.getenv("LORISpassword") |
||
| 23 | |||
| 24 | # Create the variable array that store the columns information to be used later in loop for column creation |
||
| 25 | TableName = schema.CNBP_schema_table_name |
||
| 26 | KeyField = schema.CNBP_schema_keyfield |
||
| 27 | NewColumns = schema.CNBP_schema_fields |
||
| 28 | NewColumnsTypes = schema.CNBP_schema_fields_types |
||
| 29 | |||
| 30 | NewColumnSpec = zip(NewColumns, NewColumnsTypes) |
||
| 31 | NewColumnSpecList = list(NewColumnSpec) |
||
| 32 | |||
| 33 | return LocalDBCreate(Path, TableName, KeyField, NewColumnSpecList) |
||
| 34 | |||
| 35 | # Only executed when running directly. |
||
| 36 | if __name__ == '__main__': |
||
| 37 | create_localDB_CNBP("..\LocalDB\LocalDB_CNBPs.sqlite") |
||
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.