Skip to content

Commit

Permalink
chore: reformatted unit files
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadorbs committed Nov 27, 2023
1 parent cac2aa2 commit 0dbb48e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
5 changes: 3 additions & 2 deletions LidlToGrocy.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
Application.GrocyPort := GetEx(['p', 'grocy-port'], 'grocy port', '9283');
Application.GrocyApiKey := GetEx(['a', 'grocy-apikey'], 'grocy api key');

Application.LidlCountry := GetEx(['c', 'lidl-country'], 'lidl country' , 'EN');
Application.LidlCountry := GetEx(['c', 'lidl-country'], 'lidl country', 'EN');
Application.LidlLanguage := GetEx(['l', 'lidl-lang'], 'lidl language', 'en');
Application.LidlToken := GetEx(['t', 'lidl-token'], 'lidl token (see https://github.com/Andre0512/lidl-plus#commandline-tool)');
Application.LidlToken := GetEx(['t', 'lidl-token'],
'lidl token (see https://github.com/Andre0512/lidl-plus#commandline-tool)');

Application.LidlJsonFilePath :=
GetEx(['f', 'lidl-filepath'], 'lidl json file (optional)');
Expand Down
4 changes: 2 additions & 2 deletions library/grocy.barcode.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TGrocyBarcode = class(TSynAutoCreateFields)
private
FAmount: string;
FBarcode: string;
FId: Integer;
FId: integer;
FNote: string;
FProductId: integer;
FQuId: string;
Expand All @@ -25,7 +25,7 @@ TGrocyBarcode = class(TSynAutoCreateFields)
published
property Amount: string read FAmount write FAmount;
property Barcode: string read FBarcode write FBarcode;
property Id: Integer read FId write FId default -1;
property Id: integer read FId write FId default -1;
property Note: string read FNote write FNote;
property ProductId: integer read FProductId write FProductId;
property QuId: string read FQuId write FQuId;
Expand Down
5 changes: 2 additions & 3 deletions library/grocy.error.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TGrocyError = class(TSynAutoCreateFields)
private
FErrorMessage: string;
public
function isErrorIntegrityUnique: Boolean;
function isErrorIntegrityUnique: boolean;
published
property ErrorMessage: string read FErrorMessage write FErrorMessage;
end;
Expand All @@ -24,7 +24,7 @@ implementation

{ TGrocyError }

function TGrocyError.isErrorIntegrityUnique(): Boolean;
function TGrocyError.isErrorIntegrityUnique(): boolean;
begin
Result := (FErrorMessage = 'SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: products.name');
end;
Expand All @@ -34,4 +34,3 @@ initialization
['ErrorMessage'], ['error_message']);

end.

10 changes: 5 additions & 5 deletions library/grocy.product.pas
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ initialization
'DefaultBestBeforeDaysAfterFreezing', 'DefaultBestBeforeDaysAfterOpen',
'DefaultBestBeforeDaysAfterThawing', 'DefaultConsumeLocationId', 'Description', 'DueType',
'EnableTareWeightHandling', 'HideOnStockOverview', 'Id', 'LocationId', 'MinStockAmount',
'MoveOnOpen', 'Name', 'NoOwnStock', 'NotCheckStockFulfillmentForRecipes', 'ParentProductId', 'PictureFileName',
'ProductGroupId', 'QuIdConsume', 'QuIdPrice', 'QuIdPurchase', 'QuIdStock', 'QuickConsumeAmount',
'QuickOpenAmount', 'ShoppingLocationId', 'ShouldNotBeFrozen', 'TreatOpenedAsOutOfStock'],
'MoveOnOpen', 'Name', 'NoOwnStock', 'NotCheckStockFulfillmentForRecipes', 'ParentProductId',
'PictureFileName', 'ProductGroupId', 'QuIdConsume', 'QuIdPrice', 'QuIdPurchase', 'QuIdStock',
'QuickConsumeAmount', 'QuickOpenAmount', 'ShoppingLocationId', 'ShouldNotBeFrozen', 'TreatOpenedAsOutOfStock'],
['active', 'calories', 'cumulate_min_stock_amount_of_sub_products', 'default_best_before_days',
'default_best_before_days_after_freezing', 'default_best_before_days_after_open',
'default_best_before_days_after_thawing', 'default_consume_location_id', 'description',
'due_type', 'enable_tare_weight_handling', 'hide_on_stock_overview', 'id', 'location_id',
'min_stock_amount', 'move_on_open', 'name', 'no_own_stock', 'not_check_stock_fulfillment_for_recipes',
'parent_product_id', 'picture_file_name', 'product_group_id', 'qu_id_consume', 'qu_id_price', 'qu_id_purchase',
'qu_id_stock', 'quick_consume_amount', 'quick_open_amount', 'shopping_location_id',
'parent_product_id', 'picture_file_name', 'product_group_id', 'qu_id_consume', 'qu_id_price',
'qu_id_purchase', 'qu_id_stock', 'quick_consume_amount', 'quick_open_amount', 'shopping_location_id',
'should_not_be_frozen', 'treat_opened_as_out_of_stock']);

end.
6 changes: 3 additions & 3 deletions library/kernel.application.pas
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TLidlToGrocy = class(TCustomApplication)
function AddNewGrocyProduct(LidlProduct: TItemsLine): TGrocyProduct;
procedure ConsumeGrocyProduct(LidlProduct: TItemsLine);
procedure DoHelp(Sender: TObject);
function InsertOFFImageInGrocy(OFFProductInfo: TOFFProductInfo): Boolean;
function InsertOFFImageInGrocy(OFFProductInfo: TOFFProductInfo): boolean;
function GetGrocyProduct(LidlProduct: TItemsLine): TGrocyProduct;
function GetLidlTickets: string;
function GetOFFProductInfo(var LidlProduct: TItemsLine): TOFFProductInfo;
Expand Down Expand Up @@ -91,9 +91,9 @@ procedure TLidlToGrocy.DoHelp(Sender: TObject);
ConsoleWrite(Executable.Command.FullDescription);
end;

function TLidlToGrocy.InsertOFFImageInGrocy(OFFProductInfo: TOFFProductInfo): Boolean;
function TLidlToGrocy.InsertOFFImageInGrocy(OFFProductInfo: TOFFProductInfo): boolean;
var
ImageStream : TStream;
ImageStream: TStream;
begin
Result := False;
if (OFFProductInfo.ImageUrl = '') then
Expand Down
3 changes: 1 addition & 2 deletions library/kernel.logger.pas
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class procedure TLogger.Exception(E: SysUtils.Exception; const AText: string);
DebugLn(['[EXCEPTION] ', E.Message, E]);
end;

class procedure TLogger.InfoEnter(const AText: string;
AParams: array of const);
class procedure TLogger.InfoEnter(const AText: string; AParams: array of const);
begin
DebugLnEnter(['[INFO] ', Format(AText, AParams)]);
end;
Expand Down
3 changes: 1 addition & 2 deletions service/grocy.service.pas
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ function TGrocyService.ConsumeByBarcode(Barcode: string; Amount: integer): boole
end;
end;

function TGrocyService.UploadImageFile(ImageStream: TStream; FileName: string
): boolean;
function TGrocyService.UploadImageFile(ImageStream: TStream; FileName: string): boolean;
begin
Result := False;

Expand Down
3 changes: 1 addition & 2 deletions service/openfoodfacts.service.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ class function TOpenFoodFactsService.GetProduct(BarCode: string): TOFFProductInf
end;
end;

class function TOpenFoodFactsService.DownloadImage(
OFFProductInfo: TOFFProductInfo): TStream;
class function TOpenFoodFactsService.DownloadImage(OFFProductInfo: TOFFProductInfo): TStream;
var
Client: TFPHttpClient;
FS: TStream;
Expand Down

0 comments on commit 0dbb48e

Please sign in to comment.