profile
viewpoint
Fábio C. Barrionuevo da Luz luzfcb @pythonbrasil Palmas, Tocantins, Brazil Pythonista, Linux user, open source contributor, http://pythonclub.com.br co-creator and maintainer, science fiction lover, husband, father.

aprendacomputacaocompython/aprendacompy 3

Automatically exported from code.google.com/p/aprendacompy

dvl/pyclub 1

PythonClub

lskbr/grupybr-pynorte 1

Site da PyNorte - grupo de usuários Python do Norte do Brasil

luzfcb/.dotfiles 0

minhas configurações

luzfcb/AdminLTE 0

AdminLTE - Free Premium Admin control Panel Theme That Is Based On Bootstrap 3.x

PR opened sphinx-contrib/datatemplates

update requirement for sphinxcontrib.runcmd

Use the canonical name from pypi for sphinxcontrib-runcmd (note the dash). The version with a dot causes an issue where pkg_resources cannot find sphinxcontrib.runcmd because the installed package name is sphinxcontrib-runcmd. I think this is caused because pypi has a redirect on the 'dot' version.

https://pypi.org/project/sphinxcontrib.runcmd/

+1 -1

0 comment

1 changed file

pr created time in 9 minutes

fork ssbarnea/docs-1

The open-source repo for docs.github.com

https://docs.github.com

fork in 2 hours

issue commentyourlabs/django-autocomplete-light

3.5.1 new Media order is not safely compatible with ModelAdmin.autocomplete_fields

All right, I'm trying to make the AutocompleteLight Web Component really ready, and have taken the following design decisions:

  • remove StencilJS: so we have pure ECMAScript just relying on Web Components standards instead of jQuery soup, initialization soup code, and any soup actually, after seeing that this was more performant to load: https://webcomponents.dev/blog/all-the-ways-to-make-a-web-component/
  • with a TDD rewrite of the code: spent quite some time with Cypress, Playwright and the likes in JS, found it pretty boring and inconvenient, figured pytest-playwright (not working for me) was using Splinter under the hood, a browser lib in Python which I really liked, so went for Python powered browser tests, and they are insanely fast
  • trying pnpm instead of npm or yarn this time,

You can where it's at here:

https://yourlabs.io/oss/autocomplete-light/-/tree/master/new

However, given that I'm getting away with Python powered TDD, pure ECMAScript without dependencies, I'm thinking "I might as well write my Web Component in Python", yes, with Transcrypt ... Extremely lightweight pure Python frontend development might become a reality, I confirm that throwing away my JS test code in favor of pytest-splinter was an extremely pleasant experience

raratiru

comment created time in 2 hours

issue commentpython-visualization/folium

Multiple Vincent/Vega charts in a popup?

@dsunjka I was never able to solve this. I ended up using a different chart type that encodes the data from two charts in one.

robroc

comment created time in 3 hours

startedandy-landy/traceback_with_variables

started time in 4 hours

issue commentaldjemy/aldjemy

New Release

I haven't been maintaining a changelog, unfortunately. I didn't realize there was previously one. The closest thing we have at the moment is the commit history. https://github.com/aldjemy/aldjemy/commits/1.0.0 Most of the changes were housekeeping, but there were two changes that added or improved functionality: #80, #101.

There were no breaking changes in 1.0. We dropped support for a bunch of versions of Django and Python from our build matrix, but I didn't actually remove any of the backward compatibility code. Because of that, I'm planning to make the next release 2.0, since we have merged some breaking changes since the 1.0 release. I don't have a timeframe on when 2.0 will be released. There are no interesting new features yet, so for the moment I'm content with what is currently released.

adamduren

comment created time in 4 hours

issue commentaldjemy/aldjemy

New Release

@ryanhiebert is there any known changelog for 1.0.0 ? as for now changelog has been updated 2 years ago :(

adamduren

comment created time in 5 hours

pull request commentjazzband/django-formtools

Refs #23 - Initialized preview form with files.

In fact, there is an issue with form_hmac calculation when we initialize a form with files. I should add a test and a fix.

claudep

comment created time in 5 hours

issue closedpython-visualization/folium

I'd like to have the generated index.html be dynamic, instead of hardcoding marker values.

Is your feature request related to a problem? Please describe. I'm building a map based on the results of a response from a REST API. The data that gets returned from the API is dynamic. When I initially created the index.html, I assumed that the JavaScript inserted into the index.html would be dynamic as well, meaning it would make the fetch request to the REST API. However, I recently noticed that the index.html has all the Markers hardcoded, so it's sort of a snapshot of how it looked when I ran the Folium script.

Describe the solution you'd like I'd like the generated JavaScript to mirror what I'm doing in Python. So for example if in Python I make a request to an API using the requests library, I'd like the generated JavaScript to also make a request to the API. Basically I'd like the code to be a 1:1 translation.

Describe alternatives you've considered I've done my workflow using just Javascript/Leaflet.

closed time in 7 hours

fpolignano

issue commentpython-visualization/folium

I'd like to have the generated index.html be dynamic, instead of hardcoding marker values.

This is currently not possible with folium. If there's a light-weight plugin we can include to make this possible, we can consider it. Read the contributing guidelines for plugin acceptance criteria. There are no plans to support this in the main library. To do more dynamic stuff you're probably better of doing this in Javascript with Leaflet directly.

fpolignano

comment created time in 7 hours

issue openedpython-visualization/folium

I'd like to have the generated index.html be dynamic, instead of hardcoding marker values.

Is your feature request related to a problem? Please describe. I'm building a map based on the results of a response from a REST API. The data that gets returned from the API is dynamic. When I initially created the index.html, I assumed that the JavaScript inserted into the index.html would be dynamic as well, meaning it would make the fetch request to the REST API. However, I recently noticed that the index.html has all the Markers hardcoded, so it's sort of a snapshot of how it looked when I ran the Folium script.

Describe the solution you'd like I'd like the generated JavaScript to mirror what I'm doing in Python. So for example if in Python I make a request to an API using the requests library, I'd like the generated JavaScript to also make a request to the API. Basically I'd like the code to be a 1:1 translation.

Describe alternatives you've considered I've done my workflow using just Javascript/Leaflet.

created time in 7 hours

push eventpydanny/cookiecutter-django

pyup-bot

commit sha 9d6f661d4042b3f3c355f7c559f45bb7c62fa2d1

Update django-debug-toolbar from 3.1.1 to 3.2

view details

push time in 7 hours

PR opened pydanny/cookiecutter-django

Update django-debug-toolbar to 3.2

This PR updates django-debug-toolbar from 3.1.1 to 3.2.

<details> <summary>Changelog</summary>

3.2

----------------

* Moved CI to GitHub Actions: https://github.com/jazzband/django-debug-toolbar/actions
* Stopped crashing when ``request.GET`` and ``request.POST`` are
dictionaries instead of ``QueryDict`` instances. This isn&#39;t a valid
use of Django but django-debug-toolbar shouldn&#39;t crash anyway.
* Fixed a crash in the history panel when sending a  JSON POST request
with invalid JSON.
* Added missing signals to the signals panel by default.
* Documented how to avoid CORS errors now that we&#39;re using JavaScript
modules.
* Verified support for Python 3.9.
* Added a ``css`` and a ``js`` template block to
``debug_toolbar/base.html`` to allow overriding CSS and JS.

3.2a1

------------------

* Fixed a regression where the JavaScript code crashed with an invalid
CSS selector when searching for an element to replace.
* Replaced remaining images with CSS.
* Continued refactoring the HTML and CSS code for simplicity, continued
improving the use of semantic HTML.
* Stopped caring about prehistoric browsers for good. Started splitting
up the JavaScript code to take advantage of JavaScript modules.
* Continued removing unused CSS.
* Started running Selenium tests on Travis CI.
* Added a system check which prevents using django-debug-toolbar without
any enabled panels.
* Added :meth:`Panel.run_checks() &lt;debug_toolbar.panels.Panel.run_checks&gt;` for
panels to verify the configuration before the application starts.
* Validate the static file paths specified in ``STATICFILES_DIRS``
exist via :class:`~debug_toolbar.panels.staticfiles.StaticFilesPanel`
* Introduced `prettier &lt;https://prettier.io/&gt;`__ to format the frontend
code.
* Started accessing history views using GET requests since they do not
change state on the server.
* Fixed a bug where unsuccessful requests (e.g. network errors) were
silently ignored.
* Started spellchecking the documentation.
* Removed calls to the deprecated ``request.is_ajax()`` method. These calls
were unnecessary now that most endpoints return JSON anyway.
* Removed support for Python 3.5.

</details>

<details> <summary>Links</summary>

  • PyPI: https://pypi.org/project/django-debug-toolbar
  • Changelog: https://pyup.io/changelogs/django-debug-toolbar/
  • Repo: https://github.com/jazzband/django-debug-toolbar </details>
+1 -1

0 comment

1 changed file

pr created time in 7 hours

startedbigskysoftware/htmx

started time in 9 hours

issue commentpython-visualization/folium

Multiple Vincent/Vega charts in a popup?

I am also interested - @robroc Did you come up with a solution in the meanwhile?

robroc

comment created time in 9 hours

issue commentpython-visualization/folium

Map Resizing

this worked for me @Singh1106 ! thank you :)

silentttone

comment created time in 12 hours

push eventpythonbrasil/wiki

APyB Travis Bot

commit sha 9d31cb690e9b12181cc6e0101a9ee91869f10a09

Updated APyB site.

view details

push time in 14 hours

issue commentpython-visualization/folium

Custom Markers only work with URLs

thank you @davidolmo this really helped me.....

nanodan

comment created time in 15 hours

pull request commentyourlabs/django-autocomplete-light

Added ability to specify value on list and group-list selections

Codecov Report

Merging #1200 (f15bf67) into master (10d7f2c) will increase coverage by 0.26%. The diff coverage is 95.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1200      +/-   ##
==========================================
+ Coverage   89.58%   89.85%   +0.26%     
==========================================
  Files         113      113              
  Lines        2218     2345     +127     
==========================================
+ Hits         1987     2107     +120     
- Misses        231      238       +7     
Impacted Files Coverage Δ
test_project/select2_list/forms.py 88.88% <50.00%> (-11.12%) :arrow_down:
test_project/select2_list/views.py 83.33% <66.66%> (-16.67%) :arrow_down:
src/dal_select2/views.py 87.93% <90.24%> (-1.32%) :arrow_down:
src/dal_select2/fields.py 100.00% <100.00%> (ø)
test_project/select2_list/test_fields.py 100.00% <100.00%> (ø)
test_project/select2_list/test_views.py 100.00% <100.00%> (ø)
test_project/select2_list/urls.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 10d7f2c...f15bf67. Read the comment docs.

OmenApps

comment created time in 16 hours

push eventpydanny/cookiecutter-django

browniebroke

commit sha 1164d9cbcb5960046d1dce4331912f58c9b6d3d6

Update Changelog

view details

push time in 17 hours

startedmarmelo/tech-companies-in-portugal

started time in 21 hours

Pull request review commentyourlabs/django-autocomplete-light

Added ability to specify value on list and group-list selections

 make it easier to avoid problems when using Select2ListView. For example:             widget=autocomplete.ListSelect2(url='country-list-autocomplete')         ) -Since the selections in Select2ListView map directly to a list, there is no-built-in support for choices in a ChoiceField that do not have the same value-for every text. ``Select2ListCreateChoiceField`` allows you to provide custom+By default, the selections in Select2ListView can map directly to a list,+resulting in the same text and value for each option.+++To define your own values for each selection, provide a list-of-lists or+list-of-tuples for the Select2ListView choice_list, and use Select2ListView+instead of Select2ListView. For example:++.. code-block:: python++    class CountryAutocompleteFromList(autocomplete.Select2ListView):+    def get_list(self):

Nice, not much to say here, it's really a quality contribution you got right there, with tests and documentation :tophat:

OmenApps

comment created time in a day

fork xmnlab/pymapd-feedstock

A conda-smithy repository for pymapd.

fork in a day

issue commentyourlabs/django-autocomplete-light

Option to select all matching entries in multi selects

I needed this and i needed this with implemented with ajax(because of the large select options). Here is my overly hacky/completed solution for this:

In form field i keep the default widget and don't use dal widget. Also I set the queryset to none since I will be using the ajax to get the items.

forms.py


    terms = ModelMultipleChoiceField(
        queryset=Term.objects.none(),
        required=False,
        # widget=autocomplete.ModelSelect2(url='dove:term_autocomplete')
    )

Difference in view class is that I set the paginate_by to a high number so I don't have to deal with pagination.


# views.py
class TermAutocomplete(autocomplete.Select2QuerySetView):
    paginate_by = 1000

    def get_queryset(self):
        # Don't forget to filter out results depending on the visitor !
        if not self.request.user.is_authenticated:
            return Term.objects.none()

        qs = Term.objects.all()

        if self.q:
            qs = qs.filter(label__icontains=self.q)
        return qs

In javascript:

  • I manually initiate the select2 on the select field.
  • We get objects with ajax call. However objects when displayed in select2 dropdown don't have their pk.
  • Using the select2 templateResult I added back object pk to dropdown li elements.
  • After search is made I added at the top of the search field a "Select All" button.
  • Since there are no options in select we add the options using the pk's we added with template.
  • Lastly select them all using .val()

function formatResult(r) {
    return $('<span id="select2-result-id-' + r.id + '">' + r.text + '</span>');
}

  $("#id_terms").select2({
      minimumInputLength: 3,
      templateResult: formatResult,
      ajax: {
        url: "{% url 'dove:term_autocomplete' %}",
	dataType: 'json',
        cache: false,
	// Additional AJAX parameters go here; see the end of this chapter for the full code of this example
      }
  });

  var terms_search_field = $("#id_terms").data("select2").$selection.find('.select2-search__field');
  var terms_label =  $("#geneset-form-div")[0].querySelector("label[for='id_terms']")
  terms_label.innerHTML += '<button type="button" id="clear-all-terms">Clear All</button>'

  $("#clear-all-terms")[0].addEventListener("click", function(){
    $("#id_terms").val(null).trigger("change");
  });

  terms_search_field[0].addEventListener("keyup", function(){
      if (terms_search_field.val().length >= 3) {
        var results = $("#select2-id_terms-results")[0];
        if (!results.innerHTML.includes("select-all-matched-terms")) {
          results.innerHTML = '<li><button type="button" id="select-all-matched-terms">Select All</button></li>' + results.innerHTML
        }

        $("#select-all-matched-terms")[0].addEventListener("click", function(){
          var matches = [];
          $.each($(".select2-results__options").find('li'), function(i, item) {
              var term_id = item.children[0].id.split("-").splice(-1)[0];
              var term_text = item.children[0].textContent;
              if (term_id.length > 0 && term_id != "terms"){
                if ($('#id_terms').find("option[value='" + term_id + "']").length) {
                    $('#id_terms').val(term_id).trigger('change');
                } else { 
                    // Create a DOM Option and pre-select by default
                    var newOption = new Option(term_text, term_id, true, true);
                    // Append it to the select
                    $('#id_terms').append(newOption).trigger('change');
                } 
                matches.push(term_id);
              }
          });
          $("#id_terms").val(matches).trigger("change");
          terms_search_field[0].value = "";
          $("#id_terms").select2("close");
        });
      }
  // Do something
  });

marekjedrzejewski

comment created time in a day

Pull request review commentyourlabs/django-autocomplete-light

Added ability to specify value on list and group-list selections

 make it easier to avoid problems when using Select2ListView. For example:             widget=autocomplete.ListSelect2(url='country-list-autocomplete')         ) -Since the selections in Select2ListView map directly to a list, there is no-built-in support for choices in a ChoiceField that do not have the same value-for every text. ``Select2ListCreateChoiceField`` allows you to provide custom+By default, the selections in Select2ListView can map directly to a list,+resulting in the same text and value for each option.+++To define your own values for each selection, provide a list-of-lists or+list-of-tuples for the Select2ListView choice_list, and use Select2ListView+instead of Select2ListView. For example:++.. code-block:: python++    class CountryAutocompleteFromList(autocomplete.Select2ListView):+    def get_list(self):

Will fix this and the ci identified issue this evening.

OmenApps

comment created time in a day

issue openedaws/aws-xray-sdk-python

Integration test framework - Destroy resources

Currently we destroy resources if tests are passing successfully. I think we should destroy resources even if tests have failed because that would absolutely reduce overhead of managing resources in the case of test failures.

created time in a day

issue openedaws/aws-xray-sdk-python

Deprecate support for python 2.7 and 3.4 in the next major version

Python 2.7(the last of python2) and 3.4 have reached their end-of-life and are no longer supported.

The SDK should deprecate the support for these versions in the 3.0.0 release. FYI, the OpenTelemetry for Python supports python 3.5 and above.

created time in a day

issue commentaws/aws-xray-sdk-python

EC2 plugin is not compatible with python2

As you might be aware that the python 2.7 has reached its end of life and is no longer supported. We would be dropping the support for python2 as well in the next major version of the SDK. You may want to upgrade to python3 to reap all the benefits.

yonash2

comment created time in a day

more