Monthly Archives: October 2020

[ann] Telegram Bots with Pharo

Hi everyone, I share a tool for creating telegram Bots with Pharo. This library provides an interface for the Telegram Bot API.

To create our telegram bot in Pharo, the first thing we need to do is to create a new object that inherits from Bottlegram. This object must define at least these three methods:

  • slashStart: to be executed when the bot receives /start.
  • slashHelp: to be executed when the bot receives /help.
  • defaultText: to be executed when the bot receives an unknown command.

The tool allows creating bots using two methods:

  • Using polling: the bot check updates for an amount of time.
  • Using webhook: Use this method to create a Teapot server to receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we received an HTTPS POST request to the specified URL

Github link: https://github.com/pablo1n7/bottlegram

If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot

Saludos, Pablo.

[Ann] P3 version 1.3 – PostgreSQL client

Hi,

There is a new release of P3, the modern, lean and mean PostgreSQL client for Pharo.

https://github.com/svenvc/P3

Version 1.3 contains the following changes:

– Add object logging, see the P3LogEvent hierarchy
– Added P3ConnectionPool with tests
– Better management of prepared statements
– Add support for Chronology objects Time, Date and DateAndTime to be used directly as binding arguments for formatted/prepared statements, with tests
– Added basic support for array based parameter binding, see P3ValuesArray and #printValuesArrayOn:
– Better documentation and fallback for session/connection timezone and character encoder/decoder
– Reimplementation of P3Error adding unique codes and #isLocal as opposed to PostreSQL server generated messages; signalling now happens with instances created by class side accessors
– Bring back P3Client>>#queryEncoding as an alias for P3Client>>#serverEncoding as compatibility support for PharoDatabaseAccessor
– Add P3DatabaseDriver>>#connectSSL:
– Various cleanups and internal improvements 

https://github.com/svenvc/P3/releases/tag/v1.3

The quality of open source software is determined by it being alive, supported and maintained.

The first way to help is to simply use P3 in your projects and report back about your successes and the issues that you encounter. You can ask questions on the Pharo mailing lists.

I want to thank all contributors and users for their help and feedback: you make a real difference.

Since the end of last year, I have been using P3 in a real commercial production context, processing 10.000s of inserts a day and successfully supporting a web application for consulting the data. 

Enjoy,

Sven


Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org

[ann] Eleven

Hello,

I am using https://github.com/JanBliznicenko/eleven for one of my projects.
It is also a full framework, yet much simplier than Seaside and stateless
and I believe only the HTML building functionality can be used indpendently.

Example:
htmlObject := HtmlBody
with:
(HtmlDiv
class: ‘content’
with:
(HtmlAnchor new
href: ‘https://pharo.org‘;
targetBlank;
with: ‘Pharo website’;
yourself)).
String streamContents: [:stream | htmlObject renderFor: nil on: stream]

The nil I am passing in the last line is there in place of an ELRequest
entity and is not needed for simple HTML tags without custom components. You
might check it out. Be aware that my former colleague created it for our
specific project and I have never used it in any other place, so I just HOPE
it would work like I imagine. It is also not documented or tested at all.

Best regards,
Jan

This week (41/2020) on the Issue Tracker

Not communicating does not mean that we are not working 🙂 In fact we got busy. And we will start to have weekly log of activities.

Parser/Syntax Highlighting

Improvement to make the prior huge improvement on parsing of syntactically wrong
code much more usable:

Several fixes to the parser and syntax feedback #7411
https://github.com/pharo-project/pharo/pull/7411

First class Variables / Compiler cleanup

Lots of work has been done to unify all meta objects describing Variables into one  hierarchy (see Variable and subclasses). This in turn enables many
cleanups and simplification on the level of the name analysis of the Compiler and the API that the debugger uses to read Variables. Nearly finished, but some smaller steps remain:

Variable-scope-addTests #7435
(all Variable objects should know the scope where they are from)
https://github.com/pharo-project/pharo/pull/7435

Name Analysis: Lookup Slots In Class #7403
https://github.com/pharo-project/pharo/pull/7403

reduce-sends-doSemanticAnalysis #7402
https://github.com/pharo-project/pharo/pull/7402

7405-Debug-It-is-broken #7406
(this was a bad side effect of a refactoring needed to be able to move
 the call of #doSemanticAnalysis into the Compiler)
https://github.com/pharo-project/pharo/pull/7406



Fluid Class Definitions

This is ongoing work to have a better class definiton for what is now called
“slot enabeled class defintion” (the one where one can use First Class Variables and where the Layout class is shown explicitly)

7444-Prepare-fluid-class-integration-part-4 #7445
https://github.com/pharo-project/pharo/pull/7445

7437-prepare-fluid-class-integration-part-3 #7438
https://github.com/pharo-project/pharo/pull/7438

7412-preparing-the-integration-of-fluid-class-part-2 #7434
https://github.com/pharo-project/pharo/pull/7434

7431-preparing-fluid-class-Part-1 #7433
https://github.com/pharo-project/pharo/pull/7433

Debugger

Debugger-should-show-Workspace-bindings #7408
A try to simplify how the workspace binding is found when debugging.
Leads to many problems, will be reverted.
https://github.com/pharo-project/pharo/pull/7408

7362-Package-Debugger-Filters-is-not-used-and-can-be-removed #7430
https://github.com/pharo-project/pharo/pull/7430

Added a closeAllDebugger method to trait TDebugger class, that users … #7328
(just a first step, not yet solved)
https://github.com/pharo-project/pharo/pull/7328

Exposing signalContext in Exception #7417
https://github.com/pharo-project/pharo/pull/7417

ReadOnly Literals

The compiler and the VM has support to make literals read-only. As the ability
to change literals without the code reflecting it has lead to ugly bugs in the
past, turning this on looks like a good idea:

SourceFileBufferedReadWriteStreamTest-readOnlyLiteral #7418
https://github.com/pharo-project/pharo/pull/7418

betterName-isSharedLiteral #7432
https://github.com/pharo-project/pharo/pull/7432

Enable-ReadOnly-Literals #7393
https://github.com/pharo-project/pharo/pull/7393

Bug Fixes

Background failures log in CI #7337
https://github.com/pharo-project/pharo/pull/7337

5956-Wrong-format-of-DoubleWordArray #7404
Ongoing work. All code is merged, but now we need to still see that we
can create classes like that with the bootrap
https://github.com/pharo-project/pharo/pull/7404

Fix_for_PluggableSliderMorph #7415
https://github.com/pharo-project/pharo/pull/7415

7414-division-of-number-by-array-fails-with-doesNotUnderstand-isZero #7425
https://github.com/pharo-project/pharo/pull/7425
Cleaning integer division #7436
https://github.com/pharo-project/pharo/pull/7436

Comments

7042-Better-comment-for-CompiledBlock-and-FullBlock
https://github.com/pharo-project/pharo/pull/7447

Cleanups

7367-pragmas-not-needed-textEditorShiftedMenu-fileListContentMenu #7426
https://github.com/pharo-project/pharo/pull/7426

Fixed #7420. Added transformation rules to some non-transforming deprecations 
that were identified as automatable in the Deprewriter paper #7427
https://github.com/pharo-project/pharo/pull/7427

7364-RBSelectorNode-has-unclassified-methods #7424
https://github.com/pharo-project/pharo/pull/7424

7416-Fileout-a-protocol-raises-a-DNU #7441
https://github.com/pharo-project/pharo/pull/7441

7365-DictionaryValueHold-removeKey-calls-a-non-existing-method #7407
https://github.com/pharo-project/pharo/pull/7407