How to use _update_packages method in lisa

Best Python code snippet using lisa_python

viewer.py

Source:viewer.py Github

copy

Full Screen

...90 self.ui.setupUi(self)91 self.reset()92 93 94 def _update_packages(self, widget, packages, previous_packages = None, may_create = lambda name: True):95 """Update the contents of the given widget to contain one widget per package96 @param widget the QGroupWidget to fill with entries97 @param packages a dict of package-name => package_data entries98 @param previous_packages A dict of the previous state of all packages, format is similar to 'packages'99 @param may_create if True, the widget for the package with the given name may be created100 @note for now we are lazy and don't reuse widgets"""101 previous_packages = previous_packages or dict()102 for name, data in packages.iteritems():103 if not may_create(name):104 continue105 # end handle predicate106 widget.layout().addWidget(PackageWidget(self).set_package(name, data, previous_packages.get(name)))107 # end for each package108 109 # -------------------------110 ## @name Slots111 # @{112 113 def reset(self):114 """Clear the widget and make sure it doesn't display anything"""115 for widget in (self.ui.pall, self.ui.pchanged, self.ui.pnew, self.ui.premoved):116 widget.setHidden(True)117 # end for each widget to hide118 self.ui.message.setVisible(True)119 120 def set_tracker(self, tracker, changes_only = False):121 """Initialize this instance with the package tracker to visualize122 @param tracker a PackageMetaDataChangeTracker instance123 @param changes_only if True, only changed packages will be shown, not all the tracked packages124 @return self"""125 self.reset()126 127 changes = tracker.changes()128 129 packages = dict(((name, data) for data, name in tracker.iter_package_data()))130 previous_packages = dict(((name, data) for data, name in tracker.iter_package_data(previous=True)))131 132 hide_message = lambda: self.ui.message.setVisible(False)133 134 if not changes and not packages:135 log.warn("Input tracker was empty")136 return self137 # end bail out if there is nothing to display138 139 if changes:140 hide_message()141 142 # new packages143 added = set(packages.keys()) - set(previous_packages.keys())144 self.ui.pnew.setVisible(bool(added))145 self._update_packages(self.ui.pnew, packages, previous_packages, lambda name: name in added)146 147 # removed packges148 removed = set(previous_packages.keys()) - set(packages.keys())149 self.ui.premoved.setVisible(bool(removed))150 self._update_packages(self.ui.premoved, previous_packages, packages, lambda name: name in removed)151 152 # remaining packages153 remaining = set(changes.packages.keys()) - added154 self.ui.pchanged.setVisible(bool(remaining))155 self._update_packages(self.ui.pchanged, packages, previous_packages, lambda name: name in remaining)156 # end handle gui157 158 if changes_only:159 return self160 # end bail out if there where changes161 162 # fill in all packages163 hide_message()164 self.ui.pall.setVisible(True)165 self.ui.pall.setTitle("%s Packages" % capitalize(tracker.package_name()))166 self._update_packages(self.ui.pall, packages)167 168 ## -- End Slots -- @}169 ...

Full Screen

Full Screen

fabfile.py

Source:fabfile.py Github

copy

Full Screen

...5 site_folder = f'/home/nanoafrika/VueMovies'6 run(f'mkdir -p {site_folder}')7 with cd(site_folder):8 _get_latest_source()9 _update_packages()10 _set_up_nginx()11def _get_latest_source():12 if exists('.git'):13 run('git fetch')14 else:15 run(f'git init')16 run(f'git remote add origin {REPO_URL}')17 run('git fetch')18 current_commit = local("git log -n 1 --format=%H", capture=True)19 run(f'git reset --hard {current_commit}')20def _update_packages():21 run('/home/nanoafrika/.nvm/versions/node/v8.11.1/bin/npm install')22 run(f'/home/nanoafrika/.nvm/versions/node/v8.11.1/bin/npm run build')23def _set_up_nginx():24 if not exists('/etc/nginx/sites-available/movies'):25 sudo('cp nginx.template.conf /etc/nginx/sites-available/movies')26 sudo('ln -s /etc/nginx/sites-available/movies /etc/nginx/sites-enabled/movies')...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful