Saravanan666/pypi-org huggingface dataset:
Package: tgapp-flatpages
About flatpagesflatpages is a Pluggable application for TurboGears2 meant
to simply management of simple static pages inside your
TurboGears application.Instead of creating a controller and template for “About”,
“Contacts” and similar pages, just plug flatpages and
edit them directly from the administration interface.Installingflatpages can be installed both from pypi or from bitbucket:pip install tgapp-flatpagesshould just work for most of the usersPlugging flatpagesIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with flatpages:plug(base_config, 'flatpages')You will be able to access the plugged application
management interface athttp://localhost:8080/pages/managewhile all the pages you create will be served athttp://localhost:8080/pages/PAGENAME.Restricting access to pagesflatpages supports restricting access to pages only to users
that has a specific permission. When creating the page
set it toPublic,Only Registered Usersor any of
thePermissionyour application provides.Loading pages from fileWhen working with static pages it’s often easier to include
the starting version or new versions into the source code itself
instead of providing a database migration each time the content
has to be changed.To allow this, flatpages permits to load the page content
from a file local to the application itself. To do so
it’s sufficient to setfile://path/relative/to/application/packageas the content of the static page.Optionsflatpages exposes some options to control the behavior when
rendering a page, pass this to the plug call to set them:format-> This is the format used to render the page content,
can behtmlorrstif you store pages in RST or HTML format. from version 0.4.0 defaults tohtmltemplates-> This is a list of the templates available to render
the pages. Each entry is in the form:("engine:package.templates.path", "Template Description").Example of plugin using genshi as template engine:plug(base_config, 'flatpages', format='html',
 templates=[("genshi:yourproject.templates.flatpages.page", "default")],
global_models = True)Overriding crud templatesyou can find tgext.admin templates here:https://github.com/TurboGears/tgext.admin/tree/master/tgext/admin/templates/bootstrap_crudand override them in your app_cfg.py with something like:replace_template(base_config,
                 'tgext.admin.templates.bootstrap_crud.get_all',
                 'myproject.templates.crud.get_all')Hooksflatpages exposes some hooks to control the behavior when
rendering a page:flatpages.before_override_template-> This is the hook called before the template gets overrided by the info, passed as args an object with page slug and self.flatpages.after_override_template->  This is the hook called after the template gets overrided by the info, passed as args an object of FlatPage and self .
Package: tgapp-googlePlusAuth
About googleplusauthgoogleplusauth is a Pluggable application for TurboGears2.It aims at making easy to implement authentication and registration with
Google in any TurboGears2 application.Installinggoogleplusauth can be installed both from pypi or from bitbucket:pip install tgapp-googleplusauthshould just work for most of the usersPlugging googleplusauthIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with googleplusauth:plug(base_config, 'googleplusauth')on a sql database, to create the table, you can run the migration(s) with:gearbox migrate-pluggable -c development.ini googleplusauth upgradeor if you can still drop the database,setup-appshould be just fine.Googleplushaut Helpersgoogleplusauth provides a helpers which will automatically
generate the buttons and the javascript required to let
your users log into your application using Google:h.googleplusauth.login_button(client_id, scope=None, data_cookiepolicy=None, img_btn_login=None, remember=None)Places a login/registration button, automatically creates a new user if he never logged with google, otherwise simply logs him in.Theclient_idparameter is YOUR_CLIENT_ID.apps.googleusercontent.comThescopeparameter is the permissions that the application will ask to google.
By default those are onlyhttps://www.googleapis.com/auth/userinfo.email.
For more scope:https://developers.google.com/oauthplayground/Thedata_cookiepolicyparameter indicate the domains for which to create sign-in cookies.Theimg_btn_loginparameter indicate the button image url.Therememberparameter can be used to log the user with an expiration date instead
of using a session cookie, so that the session can last longer than the browser tab life.This is the html of the button, if you want customize the button style:<div id="button-container">
    <div id="google-login-button" style="cursor: pointer;" onclick="perform_google_login()">
        <img id="img-login" src='%(img_btn_login)s' alt='Google Login' />
    </div>
</div>Available Hooksgoogleplusauth makes available a some hooks which will be
called during some actions to alter the default
behavior of the appplications:googleplusauth.on_registration(google_response, user)-> Runs when it is registering a new user from googlelogin, permits to add or modify additional data to the user.googleplusauth.on_login(google_response, user)-> Runs when user perform google login,permits to update the user data.Google Id and Profile PictureUsers will have a new related entity calledgoogleplusauth.
Accessinguser.googleplusauthit is possible to access the useruser.googleplusauth.google_idanduser.googleplusauth.profile_pictureand more.
Package: tgapp-invitations
About tgapp-invitationstgapp-invitations is a Pluggable application for TurboGears2.allows the users withinvitations-invitepermission to invite people via emailthis pluggable requirestgapp-registrationto be pluggedInstallingtgapp-invitations can be installed from pypi:pip install tgappinvitationsPlugging tgapp-invitationsIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with tgappinvitations:plug(base_config, 'invitations')You will be able to access the plugged application athttp://localhost:8080/invitations.Optionsinvite_required(default:True): whenFalsethe normal tgapp-registration flow is preserved.
Package: tgapp-mailtemplates
About mailtemplatesmailtemplates is a Pluggable application for TurboGears2.mailtemplates provides a dashboard meant for managers of your website (whoever has themailtemplatespermission) allowing them to customize the templates of the email that are sent from your application.the templates are stored in a database and bothsqlalchemyandmingare supported.kajiki is the template engine used.Installingmailtemplates can work withtgext.asyncjobortgext.asyncjobyou can choose by installing with the right bundle:pip install "mailtemplates[asyncjob]"or:pip install "mailtemplates[celery]"if you just want to send emails in a syncronous context then install the base package and plug withasync_senderset toNonePlugging mailtemplatesIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with mailtemplates:plug(base_config, 'mailtemplates')For configure your default language for email templates, add the ISO 3166-2 code as parameter of theplugcall:plug(base_config, 'mailtemplates', default_language='IT')If not specified, ‘EN’ will be the default language for you app.If you intend to use tgext.celery then plug and configure itbeforeplugging mailtemplates withasync_senderoption:plug(base_config, 'mailtemplates', async_sender='tgext.celery')and in your.inifile add undercelery.CELERY_INCLUDEmailtemplates.lib.celery_tasks:celery.CELERY_INCLUDE = myapp.lib.celery.tasks mailtemplates.lib.celery_tasksYou will be able to access the plugged application athttp://localhost:8080/mailtemplates.Sending emailsaccess to the dashboard and create a mail model, then you can use:from mailtemplates.lib import send_email
send_email(
  recipients=['address@example.com'],
  sender=config.get('mail.username'),
  mail_model_name='test',
  data=dict(test='test string'),
  send_async=True,
)in your controllers to actually send the email.details of params ofsend_emailrecipients: An array representing the email address of the recipient of the emailsender: A string representing the email address of the sender of the emailmail_model_name: The name of the MailModel representing an emailtranslation: The language of a TemplateTranslation (e.g. ‘EN’). If omitted, the
default language provided while plugging mailtemplates is useddata: A dictionary representing the variables used in the email template, like ${name}send_async: The email will sent asynchronously if this flag is TrueNote on send_asyncif you are already in an asyncronous context then you can’t use tgext.asyncjob with send_async=True,
but you’re already in an asyncronous context, so you can just use send_async=False.
If you really need to send email asynchronously from an already asyncronous context, then use tgext.celery
Package: tgapp-permissions
About tgapp-permissionstgapp-permissions is a Pluggable application for TurboGears2.
tgapp-userprofile allows admins of your application to assign the users of your application to
groups, and since groups are bound to permissions to assign permissions to your usersInstallingtgapp-permissions can be installed both from pypi or from github:pip install tgapppermissionsshould just work for most of the usersPlugging tgapp-permissionsIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with tgapppermissions:plug(base_config, 'tgapppermissions')You will be able to access the plugged application athttp://localhost:8080/tgapppermissions.other special options that can be used with tgapppermissions are:exclusive_permissions(default False): only a group can be assigned to a userquery_groups: function that is called by the template, must return alist of tupleswhere
each entry is composed of the_idof the group and it’sdisplay_name. you can customize this
function to filter or and sort groups if you don’t want to show every group in your database
Package: tgapp-photos
About TGApp-PhotosPhotos is a Pluggable photos application for TurboGears2.
It has born as an example on how to use tgext.crud.EasyCrudRestController
inside a pluggable application, but can be used to quickly implement
photo galleries inside any TurboGears application.Installingtgapp-photos can be installed both from pypi or from bitbucket:easy_install tgapp-photosshould just work for most of the usersPlugging PhotosIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with photos:plug(base_config, 'photos')You will be able to access the photos process athttp://localhost:8080/photos.Exposed PartialsPhotos exposes a bunch of partials which can be used
to render pieces of the photo galleries anywhere in your
application:photos.partials:gallery-> Renders a photo gallery, if none specified renders the first availablephotos.partials:albums-> Renders preview of galleries, if none specified renders all the galleriesExposed TemplatesThe templates used by photos and that can be replaced withtgext.pluggable.replace_templateare:photos.templates.indexphotos.templates.galleryphotos.templates.gallery_partialphotos.templates.albums_partial
Package: tgapp-placeholder
About tgapp-placeholdertgapp-placeholderis a Pluggable application forTurboGears2that allows placeholder images generation on the fly.
Inspired byhttp://dummyimage.com/andhttps://github.com/darkrho/django-dummyimage.Installingplaceholder can be installed both from pypi or from github:pip install tgapp-placeholdershould just work for most of the usersPlugging placeholderIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with placeholder:plug(base_config, 'placeholder')You will be able to access the plugged application athttp://localhost:8080/placeholder.Using placeholderYou are now able to get your fake images by calling:http://you-application/placeholder/{width} #for a square image
http://you-application/placeholder/{width}x{height}
http://you-application/placeholder/{width}x{height}?text={some text value}actually the parameters you can play with are:text: a custom online text wich size is calculated to fit your image widthbgcolor: the background color in HEX rgb form (default set to ‘DDDDDD’)color: the text color in HEX rgb form (default set to ‘888888’)format: available formats availablehere(default set to PNG)font_size: font_size of the eventtual text. If none is provided it is automagically calculated to fit the whole text in the image width.MoviestarsYour movie stars by placeholder! Now you can generate custom-size placeholder images of Bill Murray, Steven Seagal and the
greatest artist of all times Nicolas Cage!Just add the name of you movie hero in the URL, like:http://you-application/placeholder/stevenseagal/{width} #for a square image
http://you-application/placeholder/nicolascage/{width}x{height}
http://you-application/placeholder/billmurray/{width}x{height}No text, bgcolor, color, format or font size needed! Just the name of an hero, and see the magic!EXTRA: Nicolas CageNicolas The Great Cage images supports the gray or the gif mode. Just add themodein your URL:http://you-application/placeholder/nicolascage/g/{width}x{height}
http://you-application/placeholder/billmurray/gif/{width}x{height}Available modes:g: gray modegif: gif modec: Wanna see some crazy stuff? Try the crazy Cage mode!Based on famous placeholder generator by Dave Cowart (http://www.placecage.com,https://www.stevensegallery.com/,http://www.fillmurray.com)
Package: tgapp-resetpassword
About resetpasswordresetpassword is a Pluggable application for TurboGears2 that
permits to change user password or reset it when lost.Installingresetpassword can be installed both from pypi or from bitbucket:pip install tgapp-resetpasswordshould just work for most of the usersPlugging resetpasswordIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with resetpassword:plug(base_config, 'resetpassword')You will be able to access the plugged application athttp://localhost:8080/resetpassword.If you usetgext.maileryou need to plug it:plug(base_config, 'tgext.mailer')Some options are available that can be set on.iniconfiguration file for your application.
At least one option is required to make activation emails
work:resetpassword.email_sender-> Outgoing mails senderIf you are usingtgext.maileryou need to set up some configuration, check here for available options:https://github.com/amol-/tgext.mailer.If you are not using neitherTurboMailortgext.mailera few more configuration
options must be set to make activation email work:resetpassword.smtp_host-> SMTP server to use to send emailsresetpassword.smtp_port-> SMTP server portresetpassword.smtp_login-> Login for authentication on SMTP serverresetpassword.smtp_passwd-> Password for authentication on SMTP serverPlugin OptionsWhen pluggingtgapp-resetpasswordthe following options
can be passed to the plug call:reset_password_form-> Full python path of the form class to use for Reset Password form. By defaultresetpassword.lib.forms.ResetPasswordFormis used.new_password_form-> Full python path of the form class to use for New Password form. By defaultregistration.lib.forms.NewPasswordFormis used.So the plug call might look like:plug(
    base_config,
    'resetpassword',
    reset_password_form='myproject.lib.resetpassword_forms.ResetPasswordForm',
    new_password_form='myproject.lib.resetpassword_forms.NewPasswordForm',
)Available Hooksresetpassword makes available a some hooks which will be
called during some actions to alter the default
behavior of the appplications:resetpassword.on_begin_reset_request(data)resetpassword.on_request(user, email_data, reset_link)resetpassword.before_render_change_password_template(user, deserialized_data)resetpassword.before_redirect(redirect_url)Exposed TemplatesThe templates used by resetpassword and that can be replaced withtgext.pluggable.replace_templateare:resetpassword.templates.index -> Page with password reset request formresetpassword.templates.change_password -> Page with change password requestExample usage (after the plug call):from tgext.pluggable import replace_template
replace_template(base_config, 'resetpassword.templates.index', 'myproject.templates.reset_password')
replace_template(base_config, 'resetpassword.templates.change_password', 'myproject.templates.change_password')
Package: tgapp-samlauth
About samlauthsamlauth is a Pluggable application for TurboGears2 to authenticate
users against an SAML2 Identity Provider.Installingsamlauth can be installed both from pypi or from bitbucket:pip install tgapp-samlauthshould just work for most of the usersPlugging samlauthIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with samlauth:pluggable.plug(base_config, 'samlauth', config_namespace='samlauth',
               userdata_adapter=base_config.sa_auth.authmetadata.identify_from_saml)You will be able to login athttp://localhost:8080/samlauth/login.UserData AdapterWhen plugging tgapp-samlauth anuserdata_adapteroption is required.
userdata adapter must be a callable that receives the identity provider data and
returns the user_id which will be used to login user. Depending on your TGAuthMetadata
the returned user_id must exist on your local database.OptionsThe options are loaded from config file inconfig_namespace, if
your config namespace is"samlauth"your options will be:samlauth.config_fileandsamlauth.enc_key_files.Available options are:.config_file-> the PySAML2 config file from where to load SP data.enc_key_files-> List of .pem files used to decrypt SAML responses.
Package: tgapp-smallpress
About TGApp-SmallpressSmallPress is a Pluggable Minimalistic Blog for TurboGears2.
It implements articles with Attachments and Tags support.
Uses CKEditor for content editing.Installingtgapp-smallpress can be installed both from pypi or from bitbucket:easy_install tgapp-smallpressshould just work for most of the usersPlugging SmallpressIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with smallpress:plug(base_config, 'smallpress')Runpaster setup-app development.iniagain to create
the tables related to smallpress and start the application.
You will be able to access the blog section athttp://localhost:8080/smallpress. Management gui
will be available when logged with an user inside
thesmallpressGroup.Enabling Whoosh IndexingSmallPress has bult in posts indexing whoosh based.
If you have Whoosh installed it will be used to perform indexing of
the articles for better lookup in search functions.When enabled Whoosh will store its index into/tmp/smallpress_whooshyou can change this path by changing thesmallpress_whoosh_indexvariable in your configuration file.Multiple Blogs SupportBy default smallpress will work with only one blog, but it supports
a preliminary multiple blogs implementation. Search and TagCloud will
be shared by all the blogs, but it is possible to filter the articles
of only one blog and manage only its articles.To create a blog access/smallpress/blogsand create a new one,
you will then be able to access the subblog and manage it by accessing/smallpress/blognameExposed PartialsSmallpress exposed a bunch of partials which can be used
to render pieces of the blogging system anywhere in your
application:smallpress.partials:articles-> Renders the list of articlessmallpress.partials:article_preview-> Renders the preview of an articlesmallpress.partials:tagcloud-> Renders the blog tagcloud sectionsmallpress.partials:search-> Renders the blog search sectionsmallpress.partials.excerpts-> Renders excerpts of a list of articlessmallpress.partials.excerpt-> Renders the excerpt of an articleAvailable HooksSmallpress exposes some hooks and options to configure its
aspects.Options that can be passed to theplugcall:form-> Full python path of the form class to use for the Article form. By defaultsmallpress.lib.forms.ArticleFormis used.The hooks that can be used with TurboGears2register_hookare:smallpress.before_create_article(article, values)-> Runs before the creation of an articlesmallpress.after_create_article(article, values)-> Runs after the creation of an article, makes possible to set additional data for newly created articlessmallpress.before_edit_article(article, values)-> Runs before displaying the edit article form, makes possible to load additional form valuessmallpress.before_save_article(article, values)-> Runs before saving the article after it got edited, makes possible to update additional data for the article.
Package: tgapp-tgcomments
About tgcommentstgcomments is a Pluggable Comments application for TurboGears2.
Comments can be added to any webpage by using thecomments_forpartial.TGComments supports Facebook for avatar if the user logged using tgapp-fbauth
or if the User model provides a similar interface. Otherwise will fallback to
Gravatar.Installingtgcomments can be installed both from pypi or from bitbucket:pip install tgapp-tgcommentsshould just work for most of the usersPlugging tgcommentsIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with tgcomments:plug(base_config, 'tgcomments')To expose comments support for an entity, just call
thecomments_for(entity)partial for
that entity inside your templates as explained in theExposed Partialssection.Exposed Partialstgcomments exposes a bunch of partials which can be used
to render pieces of the blogging system anywhere in your
application:tgcomments.partials:comments_for(entity)Given any SQLAlchemy or Ming entity (instance) which is available inside your applicationmodelmodule
it will display a list of comments for that entity with a box to add a new comment.Provided Optionstgcomments supports a bunch of options that can be passed to the plug call
to change its behavior:notify_facebook(default:True) automatically notify on facebook comments thatthe user wrote if he has logged using Facebookallow_anonymous(default:True) allow anonymous users to commentpretty_datea function that will be used to properly format dates (example: “5 minutes ago”)get_user_avatara function that will be used to get the avatar (by default searches
for theavatarproperty, then fallbacks for fb information, then fallbacks gravatar)Exposed TemplatesThe templates used by registration and that can be replaced withtgext.pluggable.replace_templateare:tgcomments.templates.comments_partialAvailable HooksTGComments exposes some hooks to configure it’s behavior, The hooks that can be
used with TurboGears2 register_hook are:tgcomments.before_add(entity, user, kw)- called before adding a comment. kw[‘body’] can be modified hereChangelog0.2.6- support turbogears 2.40.2.3- addedtgcomments.before_addhook0.2.2- fixed anon comment creation broken by v0.2.1, used pre instead of div todisplay the comment body, so it keeps newlines0.2.1- fixed ming relation with User and added author_username0.2.0- introduced compatibility with ming
Package: tgapp-tgpolls
About tgpollstgpolls is a Pluggable application for TurboGears2 that allows you to create polls and let registered and anonymous users to vote a question created by manager users.
The polls are both single choice or multiple choice! And have a termination time!Installingtgpolls can be installed both from pypi or from bitbucket:easy_install tgpollsshould just work for most of the usersPlugging tgpollsIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with tgpolls:plug(base_config, 'tgpolls')You will be able to access the registration process athttp://localhost:8080/tgpolls.Available Hookstgpolls makes available a some hooks which will be
called during some actions to alter the default
behavior of the appplications:Exposed Partialstgpolls exposes a bunch of partials which can be used
to render pieces of the blogging system anywhere in your
application:Exposed TemplatesThe templates used by registration and that can be replaced withtgext.pluggable.replace_templateare: