Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUGE PR: new config framework for Headphones #2590

Open
wants to merge 90 commits into
base: develop
Choose a base branch
from

Conversation

maxkoryukov
Copy link
Contributor

@maxkoryukov maxkoryukov commented Apr 2, 2016

HUGE PR: new config framework for Headphones

New config-framework intended to replace old version of config stuff.

Features:

  1. New structure of config page, based on templates. Make better just one checkbox - and all other checkboxes will become awesome too.
  2. Predefined set of HTML templates (OptionString, OptionDropdown, OptionBool, OptionSelect and many other, including Tabs, Messages and Blocks)
  3. Much less code to add new option: all you need - just declare option using examples. For example, you need about 4 lines of code for Checkbox with hidden block of suboptions. No more pain with html+javascript+css+a lot of python sources.
  4. l10n and i18n ready (ru-translation for ~50-60% of config page)
  5. Structure of source code was completely refactored. Packages, modules and classes are broken apart. No more huge .py files with over than 9000 lines.
  6. MetaData for options. Visible, hidden, readonly and read-write options out of the box.
  7. Soft Chroot (chroot for UI) inside
  8. A lot of code covered with tests... But it is not enough... (sort by paths, and look at headphones/config/.. : https://coveralls.io/builds/5639194)

And many other small improvements. Please look at new version, discuss, test, give feedback;)

The latest version is here: https://github.com/maxkoryukov/headphones/tree/feature/hidden-opt-pr

Bugs here https://github.com/maxkoryukov/headphones/issues/new

NOTE for maintainers: github now allows squash commits, it is good news for me - I spend a lot of time on this PR, I have rebased it twice, and now github could squash it for me 😎

bugs in PR

  • safari fixed (warnings in Font-Awesome in .less code, filter property for IE)

Update PR

Descriptions and documents

  • describe features
  • describe changes
  • describe how to use

Fixed issues

Related Pull Requests

Current Pull Request contains all changes from:

Current PR is replacement for #2581

style fix
templates for labels
drop old stuff
and many other things
* refactoring finished - all things related to options are placed to the config folder
* separate file for base-types for options
* 'me' instead of 'o' in templates
* template for Tab (with 'message' property)
* Property 'message' for tab
* CSS: column-span mixin
* improved sorting of Blocks (config)
…w model

* datamodel for config - now it works with options in ini.file
* option definitions in separate files
* new sub-workflow: 'register option'
* Config could be written to the file
* NEW: Internal options (like INTERFACE, SOFT_CHROOT ....)
* Config UI : now the work with checkboxes in enough easy - no additional stuff required to work with posted booleans
* UI : save button !!
* readonly options (stub)
…required to remove jquery link from top of the page)

* removed scripts
* fixed bug with python-docs in unittestcompat
…nfig, and added new tests. FIXED bug with values of storable options

* tests for boolext
* removed check_setting-tests
* omit log output for nosetests
* fixed TYPE for storable option value (thx tests)
* fixed bug with properties: python properties required `class Name(object):` - necessary parent describing
* fixed bug in definitions: input.size replaced for input.maxlength, and actual values in defs are changed (critical API_KEY, 32 chars, not 20)
* DOCS : added some docs to the code
* UI config parser and accepter
* another one block of options is rewritten
maxkoryukov and others added 2 commits April 19, 2016 09:18
* hidden-opt - now you could hide some items from dropdown lists with new meta `items-allow()`
* extended HTTP settings of HP are moved to advanced tab: HTTP_PROXY and HTTP_BASE are converted from OptionInternal to appropriate types, and now they are visible, and accessible for configuring through WebUI
* UPG: Font Awesome 4.6.1
* FIX: an opportunity to set HTTP-header, used by CherryPy to determine origin url of proxy (when HP works behind proxy)
* FIX: fixed template (OptionSwitch double caption)

see rembo10#2616
maxkoryukov and others added 3 commits April 22, 2016 18:26
@maxkoryukov
Copy link
Contributor Author

@AdeHub , @rembo10 are there any news related to this PR?

@rembo10
Copy link
Owner

rembo10 commented Apr 26, 2016

Ah, hey sorry - I just don't have that much time right now but I will look
at this as soon as I can
On Apr 26, 2016 2:01 PM, "maxkoryukov" [email protected] wrote:

Sad...


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2590 (comment)

@maxkoryukov
Copy link
Contributor Author

May be there is other way to provide testing? May be community could help us with testing?

@rembo10
Copy link
Owner

rembo10 commented Apr 26, 2016

Yeah I mean I could pull it into a separate branch, just not sure if I want
to pull it into develop just now because I think it has some breaking
changes? For example if we tried to revert it, the cached files break some
of the imports?
On Apr 26, 2016 2:03 PM, "maxkoryukov" [email protected] wrote:

May be there is other way to provide testing? May be community could help
us with testing?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2590 (comment)

@maxkoryukov
Copy link
Contributor Author

maxkoryukov commented Apr 26, 2016

@rembo10 there are a lot of breaking changes for developers, but I tried to design the code, saving compatibility for client installations. I mean, end user could install HP from master branch, run it, then install HP from my branch over old installation - and the HP should work properly. And back operation (from my branch to master/develop branch) - too.

The only one victim - coders. The code for HP for old branch is not compatible with new branch, because there is completely new config framework, and if you want to add new option - you should change OTHER files

@AdeHub
Copy link
Collaborator

AdeHub commented Apr 29, 2016

Looks good but I can't get it to work with Safari, same issue just hangs

@maxkoryukov
Copy link
Contributor Author

@AdeHub may be you know some service, similar to SauceLabs, which provides multibrowser tests?

The thing is SauceLabs temporary disables manual sessions, so I couldn't perform testing in browsers, other than chrome/firefox.

I will try to test it on BrowserStack.. May be they could help me to open HP on Safari 9 on Mac)))

@maxkoryukov
Copy link
Contributor Author

@AdeHub , @rembo10 tell me please, I am going to rebase this pull request (to include all new features). Is this useful? Are there any chances to merge this PR to upstream?

@maxkoryukov
Copy link
Contributor Author

@AdeHub , @rembo10 how is it going?

@rembo10
Copy link
Owner

rembo10 commented Jun 30, 2016

Hey @maxkoryukov - sorry for the late reply. I still haven't really had a chance to go over this fully. I know this might sound dumb but I'm super busy right now so can you give me a high level overview of how everything works so then I have a better understanding when I look through the code?

@maxkoryukov
Copy link
Contributor Author

@rembo10 ok, I will rebase this PR, and then append the short ABOUT section, with definitions, how it works now

@rembo10
Copy link
Owner

rembo10 commented Jun 30, 2016

Cool, can you also email me at [email protected]
On Jun 30, 2016 7:21 PM, "maxkoryukov" [email protected] wrote:

@rembo10 https://github.com/rembo10 ok, I will rebase this PR, and then
append the short ABOUT section, with definitions, how it works now


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2590 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAw69XwLKFpGeZzAH8lFH94VbwjnPoMAks5qRAk5gaJpZM4H-Qnh
.

@kainz
Copy link
Contributor

kainz commented Jul 16, 2016

Is this on track to get merged to master/develop? I ask because I have a WIP branch that refactors the database access to support postgresql (and maybe eventually a full SQLAlchemy move, but atm I'm just working on statement portability etc).

I've got that up at https://github.com/kainz/headphones/tree/with_elephants, and it works for my personal use. However, it needs a lot of cleanup work, and if this is hitting mainline, I'll want to refactor it on top of that.

That said, using psql gets rid of all the 'database is locked' problems i've seen.

@maxkoryukov
Copy link
Contributor Author

Hello, @kainz!

As you could see this PR is about huge UI improvements, primarily - SETTINGS/Configuration page, with a lot of modifications in the core of config handling.

Currently, I am in process of describing the main changes in the code (short review of all changes). I couldn't tell you, how much time it could take. Moreover, after this review, we will wait for merging of the PR.. So, finally, I don't know, when this PR will go to the upstream (and even will it go there).

In other hand, this PR is not related to the DB, so your branch should not over cross with this PR... Or I didn't understood something...

But I am sure, if you want to add new configuration options to the Headphones, it is much easier with this PR merged;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants